Display Enumeration Name in a Text Field

0
Is there a way to display the name of an enumeration field instead of the caption in a text field?  If not, is there a way to only display first four characters of an enumeration caption?
asked
2 answers
2

 

HI Jesse Pena,
It is not possible to show a Enumeration value in a textbox, if  you wanted to show , then you have create a new String attribute and populate the attribute based on the selected Enum value ( How ever this is the good practice i do) .

 For your Second question :-is there a way to only display first four characters of an enumeration caption?

Yes you can make use of  combination of Substring() and getCaption() in the Screen shot you have attached.

Ex : Substring(getCaption(EnumAttrtibute),0,3) .

 

Hope it helps

answered
0

You can use getCaption() and getKey() on enumerators to get their relevant values. More info here:

https://docs.mendix.com/refguide/enumerations-in-expressions/ 

answered