Mendix 7 is no longer supported unless you have Extended Support (for details, please contact Mendix Support). Mendix 7 documentation will remain available for customers with Extended Support until July, 2024.
Enumerations in Expressions
Enumerations are referenced by
Assume a module “OrderProcessing”, in which an enumeration “Status” is defined with two possible values: “started” and “completed”. To set the value of an attribute in a change action to “completed”, use the following code:
|
|
Conditional statements are also possible:
|
|
getCaption
Takes an enumeration value and returns the caption of this value. The caption is a translatable string and the result of this function depends on the current language.
Input parameters
- an enumeration value Type: any enumeration
Output
The caption of the enumeration value in the current language. Type: String
|
|
getKey
Takes an enumeration value and returns the key (called Name in the Modeler) of this value. The key is the technical name for the enumeration value and is language independent. See also Enumeration Values.
Input parameters
- an enumeration value Type: any enumeration
Output
The key/name of the enumeration value Type: String
|
|