Enumeration
Enumeration : Class
Enumerations are a special type of Class that provide a list of values along with localizable captions.
Description Enumerations represent lists of values with localizable captions. They are a design-time and run-time concept, meaning they are created in NexJ Studio and are part of the Model, but are also loaded into database tables for use and modification at run-time. They provide a standardized way to create lists of values, like the days of the week, and localize them or associate them with UI elements like combo boxes. They can also be associated in a parent child relationship such as country and state. Properties
allowNewValues : booleanTrue if the administrator can add create new values at run time.
association : identifierThe name of the association from the parent enumeration to this one.
Valid values based on“string”. :?[\p{L}_][\p{L}\p{N}_]*(:[\p{L}_][\p{L}\p{N}_]*)* Value must begin with a letter or an underscore. Case and length are not restricted. Letters, numbers and underscores are allowed. Colon is used as a scope separator. Spaces and other punctuation characters are not allowed.
base : identifierOptional base enumeration class with "value", class code and optional "caption", "displayOrder", "parent" and "children" attributes.
Valid values based on“string”. :?[\p{L}_][\p{L}\p{N}_]*(:[\p{L}_][\p{L}\p{N}_]*)* Value must begin with a letter or an underscore. Case and length are not restricted. Letters, numbers and underscores are allowed. Colon is used as a scope separator. Spaces and other punctuation characters are not allowed.
classificationEnumeration classification string.
Valid values based on“string”. system Values are are created at design-time and only used in code for business logic. Values never get displayed in user interfaces.
sysDisplay Values are not editable at run-time, critical for business logic and system behaviour. Values can be displayed to the user (i.e. exposed via user interfaces).
sysEdit Values are critical to business function, but certain aspects can be modified at run-time.
custom Values are only added at run-time by users.
descriptionEnumeration description.
Valid values based on“string”. 255 (maxLength) parent : identifierParent enumeration name, if any.
Valid values based on“string”. :?[\p{L}_][\p{L}\p{N}_]*(:[\p{L}_][\p{L}\p{N}_]*)* Value must begin with a letter or an underscore. Case and length are not restricted. Letters, numbers and underscores are allowed. Colon is used as a scope separator. Spaces and other punctuation characters are not allowed.
reverse : identifierThe name of the association from this enumeration to the parent one.
Valid values based on“string”. :?[\p{L}_][\p{L}\p{N}_]*(:[\p{L}_][\p{L}\p{N}_]*)* Value must begin with a letter or an underscore. Case and length are not restricted. Letters, numbers and underscores are allowed. Colon is used as a scope separator. Spaces and other punctuation characters are not allowed.
typeCodeEnumeration type code value, uniquely identifying the enumeration.
Valid values based on“string”. 20 (maxLength) upgradeable : booleanTrue if the enumeration can be automatically upgraded.
userQuickpick : booleanTrue if the users can add personalized enumeration values for display in the UI.
Content
Sequence of:
t_Enumeration_Locales [0..1]
t_Enumeration_Values [0..1]
Example
Our example enumeration is called DayOfWeekEnum.
It has a list of values named MONDAY, TUESDAY, WEDNESDAY...
the code values are "1", "2", "3", ... Each of the values has French and English captions.
In usage, (DayOfWeekEnum'MONDAY) returns "1" which you might use in a comparison like
(= currentDay (DayOfWeekEnum'MONDAY)) if currentDay was simply a String value.
To get an instance of the value use the 'get' syntax as in (DayOfWeekEnum'get'MONDAY).
To get the caption of the value, use the caption property, as in ((DayOfWeekEnum'get'MONDAY)'caption).
This will return the caption in the current invocation context's locale.
Parent topic: references