Boolean in OQL where clauses

1
Hi all, I came across a strange problem with OQL datasets, which also referenced here: https://community.mendix.com/link/questions/100328 If you write an OQL expression in a dataset with ‘WHERE some.boolean = false’ , the false is denoted with an error “cannot resolve path”, While evaluating the same with the OQL module this works fine. On the other hand, something like ‘WHERE NOT some.boolean’ doesn’t work when executed, but is not shown as an error in the Dataset. Can anyone explain what’s going on there? regards, Fabian 
asked
2 answers
3

Here’s the answer for later reference:

In a DataSet

WHERE some.boolean = 'false'

With OQL module as escaped literal

'WHERE some.boolean = ''false'' '

 

answered
0

Edit: Seems the solution below didn’t work for OP, didn’t read post fully. It definitely works in current state though!

 

To follow-up incase anyone else ends up here: It’s a boolean value, you don’t need to compare it to false or true.

 

If you want it to be true:

WHERE MyBoolean

If you want it to be false:

WHERE NOT MyBoolean

 

Naming your booleans properly helps this make more sense: “IsValid” is a great name because it reads well.

 

answered