Click or drag to resize

CommenceCategoryMetaDataCategoryID Property

Returns the category ID, -1 on error. The ID is a sequence number Commence uses to identify categories. No ID can be obtained if the category contains no items.

Namespace:  Vovin.CmcLibNet.Database.Metadata
Assembly:  Vovin.CmcLibNet (in Vovin.CmcLibNet.dll) Version: 1.0.7729.42686
Syntax
public int CategoryID { get; set; }

Property Value

Type: Int32

Implements

ICategoryDefCategoryID
Remarks
The category ID returned by this call is always a snapshot value and it is only valid for the current database even when it is part of a workgroup.

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.

See Also