Enumeration

cEnumeration Enumeration

The complete domain information (enumeration) the object is using.

Returns

The complete domain information (enumeration) the object is using.

Comments

The attribute is only valid if the enumeration is a standard generated domain meaning that any custom written domain will result in a null value.

Using the Enumeration attribute will implicitly result in a database call, fetching the domain information (unless the domain information has already been invoked earlier during the session). Therefore, avoid to read the property upon e.g. startup for initialization purposes only unless needed since such calls will always have a impact on the performance.

protected override void OnPamCreate()
{
   base.OnPamCreate();

   // Makes a DB call fetching domain info for BackorderOption first time it's called!
   cEnumeration enumBackorderOption = cmbBackorderOption.Enumeration;
   // Makes a DB call fetching domain info for PrintDeliveredLines first time it's called!
   cEnumeration enumPrintDeliveredLines = cmbPrintDeliveredLines.Enumeration;
   // Makes a DB call fetching domain info for ShipmentCreation first time it's called!
   cEnumeration enumShipmentCreation = cmbShipmentCreation.Enumeration;
}

If multiple Enumerations are to be initialized upon startup, consider to use the cEnumeration method GetMulti for such purposes. Same as above, but only using one DB call:

protected override void OnPamCreate()
{
   base.OnPamCreate();

   // Makes a DB call fetching domain info for BackorderOption, PrintDeliveredLines & ShipmentCreation, all in once the first time it's called!
   IDictionary<string, cEnumeration> enumeration = cEnumeration.GetMulti("CustomerBackorderOption", "PrintDeliveredLines", "ShipmentCreation");

   cEnumeration enumBackorderOption = enumeration["CustomerBackorderOption"];
   cEnumeration enumPrintDeliveredLines = enumeration["PrintDeliveredLines"];
   cEnumeration enumShipmentCreation = enumeration["ShipmentCreation"];
}