Type to start searching...

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 : boolean

True if the administrator can add create new values at run time.

association : identifier

The 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 : identifier

Optional 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.

classification

Enumeration 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.

description

Enumeration description.

Valid values based on“string”.
255 (maxLength)
parent : identifier

Parent 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 : identifier

The 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.

typeCode

Enumeration type code value, uniquely identifying the enumeration.

Valid values based on“string”.
20 (maxLength)
upgradeable : boolean

True if the enumeration can be automatically upgraded.

userQuickpick : boolean

True if the users can add personalized enumeration values for display in the UI.

Content
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.