This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

MFIdentifier : Vault element with the alias "CL.Coexya.RH.MTAM.DemandeMtam" is not found.

Hello,

I am getting errors after adding new MFidentifiers to my code. I am probably not understanding when it's instanciated. The code is simple: 

public class VaultApplication
        : MFiles.VAF.Extensions.ConfigurableVaultApplicationBase<Configuration>
    {
        [MFPropertyDef(Required = true)]
        MFIdentifier mfIdPropMatricule = "PD.Matricule";
        [MFPropertyDef(Required = true)]
        MFIdentifier mfIdPropEmail = "M-Files.UserSynchronization.Email";
        [MFPropertyDef(Required = true)]
        MFIdentifier mfIdPropCommentaires = "PD.Commentaires";
        [MFPropertyDef(Required = true)]
        MFIdentifier mfIdPropCommentaire = "PD.Commentaire";
        [MFPropertyDef(Required = true)]
        MFIdentifier mfIdPropActeur = "PD.Coexya.RH.ActeurDuWorkflow";
        [MFPropertyDef(Required = true)]
        MFIdentifier mfIdPropEtapeAvant = "PD.EtapeAvant";
        [MFPropertyDef(Required = true)]
        MFIdentifier mfIdPropResolution = "PD.Coexya.RH.Resolution";
        [MFPropertyDef(Required = true)]
        MFIdentifier mfIdPropResolutions = "PD.Coexya.RH.Resolutions";

        [MFClass(Required = true)]
        MFIdentifier mfIdClassDemandeSAOexterne = "CL.Coexya.RH.SAO.DemandeSaoExterne";
        [MFClass(Required = true)]
        MFIdentifier mfIdClassDemandeSAOinterne = "CL.Coexya.RH.SAO.DemandeSaoInterne";
        [MFClass(Required = true)]
        MFIdentifier mfIdClassDemandeMtam = "CL.Coexya.RH.MTAM.DemandeMtam";
        
        [...]
        
        [EventHandler(MFEventHandlerType.MFEventHandlerBeforeCheckInChangesFinalize, Priority = 1, FilterOptions = MFEventFilterOptions.IgnoreTemplates)]
        public void BeforeCheckInChangesFinalize(EventHandlerEnvironment env)
        {
            [...]

            //class MTAM = 0
            if(currentObject.Class == (int)mfIdClassDemandeMtam || currentObject.Class == (int)mfIdClassDemandeSAOexterne || currentObject.Class == (int)mfIdClassDemandeSAOinterne)
            {
                commentairePropertyID = (int)mfIdPropResolution;
                commentairesPropertyID = (int)mfIdPropResolutions;
                acteurPropertyID = (int)mfIdPropActeur;
                etapeAvantPropertyID = (int)mfIdPropEtapeAvant;
            }

I am getting the error when the first MFidentifiers is used. ((int)mfIdClassDemandeMtam) . If I put the ID , then of course it works but it stop to next mfidentifier ((int)mfIdPropResolution).

mfIdPropMatricule and mfIdPropEmail are working fine in another function. There are the first added to my app.

A collleague and me crosscheck that thoses aliases are in the correct vault. We copied the aliases form the vault to visual studio.

Any hint?

Thanks, 

Amaury

Parents Reply Children
  • Sorry Craig but I have another question on the same topic Slight smile

    What could cause the no resolution of the MFIdentifier in the configuration class? it looks like that:

    using MFiles.VAF.Configuration;
    using System.Runtime.Serialization;
    
    namespace client.vem
    {
        [DataContract]
        public class Configuration : MFiles.VAF.Extensions.Configuration.ConfigurationBase
        {
    
            //PROPERTIES
            [DataMember]
            [MFPropertyDef(Required = true)]
            public MFIdentifier mfidPDLogiciel = "MF.PD.LOGICIEL"; 
            [DataMember]
            [MFPropertyDef(Required = true)]
            public MFIdentifier mfidPDIDGed = "MF.PD.IDGED";
            
            [...]

    thank you?

  • In your code, if you reference "this.Configuration.mfidPDIDGed.ID", what does this resolve to?  -1?  Is there a property in your vault with that alias?

  • Hah, I realised that something I am using actually solves this problem.

    The issue is that your code adds that the property definition is required, but in the JSON configuration it's empty.

    If you are assigning a default value and you want your code to test whether it's valid then you can state that in your code:

    		[DataMember]
    		[MFPropertyDef(AllowEmpty = true)]
    		public MFIdentifier mfidPDIDGed = "MF.PD.IDGED";