Greather or lower than ENUM - Mendix Forum

Greather or lower than ENUM

0

Hi there!

I have an entity, Order with an enum attribute: Status. With options as Created, Planned, Executed, Billed.
I want to check whether the status of my order comes after the status Planned. Can I do this with an expression?
Something like this: https://www.tutorialspoint.com/java/lang/enum_compareto.htm 

Thanks!

asked
1 answers
0

My solution to this problem would be:

Enum_Status = ‘Executed’ or Enum_Status = ‘Billed’

As far as I know enum do not have a specific order other than alphabetical for sorting.

Another solution:

Create integer variable with

if Enum_Status = ‘Created’

then 1

else if Enum_Status = ‘Planned’

then 2

else if Enum_Status = ‘Billed’

then 3

else if Enum_Status = ‘Executed’

then 4

else empty

and finally compare this number to the enum value of your choice

answered