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

C# : Set a default value for MFIdentifier in Configuration

Hello, 

In a VAF application, I want to show the MFidentifier in configuration panel. But I can't make the default value work. It's always marked as error. For example:

[DataMember]
[MFPropertyDef(Required = true)]
public MFIdentifier mfIdPropActeur = "PD.SOCLE.Acteur";

[DataMember]
[MFPropertyDef(Required = true)]
[JsonConfEditor(DefaultValue = "PD.SOCLE.Action")]
public MFIdentifier mfIdPropAction = "PD.SOCLE.Action";

The question is simple : how to make work? How to specify 

Thanks,

Amaury Bianchi

Parents
  • Hello,

    I have additional issues. When I first deploy my app, all the datamember are red in the admin, but raise no error.

    But if I complete one and save, then all the oters are now in error.

    They are declared like that: 

    [DataMember]
    [MFPropertyDef]
    [JsonConfEditor(DefaultValue = "M-Files.UserSynchronization.Email")]
    public MFIdentifier mfIdPropEmail = "M-Files.UserSynchronization.Email";
    
    [DataMember]
    [MFPropertyDef]
    [JsonConfEditor(DefaultValue = "PD.EtapeAvant")]
    public MFIdentifier mfIdPropEtapeAvant = "PD.EtapeAvant";
    
    [DataMember]
    [MFPropertyDef]
    [JsonConfEditor(DefaultValue = "PD.Coexya.Service")]
    public MFIdentifier mfIdPropService = "PD.Coexya.Service";
    
    [...]

    Adding a "(Validate = false)" tag change nothing....

    How to make a proper configuration in this case?

    I juste want to show the alias with default values and be able to some of them if necessary.

    Thank you

  • In the example I linked to earlier, it showed how to make one property optional.  You don't seem to have used the AllowEmpty property that the example does.

    Editors (m-files.com)

  • What a fast answer !

    I am sorry for missing that, I was reluctant to use that tag because it allow the user to put nothing then save... But that's better than errors.

    I have another question about this. What does this tag do?

    I didn't really understood.

Reply Children