Extend Booleans with null - Mendix Forum

Extend Booleans with null

8

most often, booleans are true/false.

but a lot of the time there is also an “unknown” status.

accepted, declined, unset/unkown.

in other languages this translates to: true/false/null

I'm pretty sure booleans are a very core feature of MX, so not likely to change, but creating an Enum just to add a “null” status seems overkill.

maybe we can have an advanced button, to extend it with unset/unkown/null.

this would save a lot of random Enums needing to be created in applications (or converting booleans to Enums, because the specs werent clear)

asked
2 answers

Booleans by nature can ONLY be true or false; if they have another option, then they are not booleans. This isn't a Mendix thing it's computer science.

 

You can create one enum with true, false, unknown and use that everywhere

Created

When you have to handle privacy fields in Italy/EU is necessary that all fields are not "pre-filled", 

 

So I think that the Idea above should be taken in condideration, creating enums for something that a simple radio could handle is very annoying.

 

Thanks

M

Created