How to Programmatically Add Value List on Application Startup

In our application we have some value list that the application uses for further processing. And we don't want user will manually import or add the value list.

Is it possible to add a value list at application startup?

Can add item to a existing value list. Also tried this - https://developer.m-files.com/APIs/COM-API/Reference/MFilesAPI~VaultValueListOperations~AddValueListAdmin.html

But not sure how the ObjTypeAdmin object should be populated for creating value list.

Parents
  • I would personally generally guide you away from altering vault structure during application startup.  Vault structure is often something which people spend significant time designing, and my personal view is that simply adding a vault application should not interfere with that.

    That said: if you must then the way forward is to use the API method you linked to, from the appropriate place in the vault application startup.  From recollection the key part here is to ensure that you use the correct vault reference from the correct place in the startup logic, otherwise you'll get errors when you try.  I don't have more direct guidance to hand, though, as it's something that I don't personally do very often.

Reply
  • I would personally generally guide you away from altering vault structure during application startup.  Vault structure is often something which people spend significant time designing, and my personal view is that simply adding a vault application should not interfere with that.

    That said: if you must then the way forward is to use the API method you linked to, from the appropriate place in the vault application startup.  From recollection the key part here is to ensure that you use the correct vault reference from the correct place in the startup logic, otherwise you'll get errors when you try.  I don't have more direct guidance to hand, though, as it's something that I don't personally do very often.

Children