CategoryDefCategoryID Property |
Namespace: Vovin.CmcLibNet.Database.Metadata
Example: A 'Person' category in one client may have a different id on another client, even when they are in the same workgroup.
Category IDs are reused in Commence. Examples:
If you delete category X and recreate it with the same name, it may get another id than it had before. If you delete category X and create another category Y, it may get the id category X had.
Do not build persistent key-value pairs of categories and ids but always use whatever Commence provides. As part of the synchronization process (in a workgroup) it will provide several files which will contain the current lookup tables.
There is an edge situation in which the ID will not be obtainable: if a category is intentionally empty and 'protected' by a Commence Agent that automatically deletes new items as soon as they are created, this property will always return -1.
An intentionally empty category is not as exotic as it may seem. An example of such a category is one that is one that only contains Item Detail Forms that perform specialized scripting, or a category that contains highly customized Report Viewer reports.
When the ID cannot be obtained by CategoryID, the only way to get the ID is to manually look it up in Help | System Information | Category Information.