Creating new object without supplying all required fields.

Is there a way, using the COM API, to create a new object that has required properties without supplying them (other than the name or title)?

  • The COM API will not allow you to create an object without the properties which are defined on the class as mandatory.

    If the properties are defined via MDCC rules then it will allow it.

    The only exception I can recall is when creating templates (Is Template = Yes).  Templates do not need to have the mandatory properties added.  I would assume (but have not checked) that the COM API is clever enough to fail if you create an object as a template, then attempt to remove the template flag.

  • I haven't tested this myself, so I'm just basing this off the description of the setting.  But if you go to Advanced Vault Settings > Configuration > Properties > Required Properties, there is a configuration item called "Allow Empty Values with API Calls". It's no by default, so maybe try setting it to yes? But it does look like a global setting, so I'm guessing if you allow it you'll be allowing it for every object type and every API app.

  • Aha, I forgot about this!  I believe that it was added to assist smart migration.

    That said: I would be relatively worried about turning this on globally.  With this off (the default) M-Files objects should be relatively consistent (properties that are mandatory will have values).  With this turned off you may inadvertently cause other related issues (e.g. scripts that expect properties to have values that now do not).  Turn it on with caution.