Boolean operation not working in BPM query

I have a BPM query that checks whether a part revision is approved or not. This works in a normal BAQ by setting a table criteria to check whether the field “Approved” = “1”. When I do this in the BPM query editor (which looks very similar to the BAQ editor), I get the following error when saving the BPM:

“Error CS0019: Operator ‘==’ cannot be applied to operands of type ‘bool’ and ‘int’”

I tried setting the value to “true”, but that didn’t work either.

Any thoughts?

What’s your code that you’re using to compare?

Does SQL comparison use == ?

No, that is C#

Can you try changing the “1” to a constant value of “true”, with no quotes?

4 Likes

I tried that before as TRUE, but I tried your suggestion without caps and it worked. Thanks!

Hi Fred,

Are you certain your error is not with your “and” criteria? I just checked in the BAQ designer for 10.1.600.5 and it works using constant of 1 for the boolean checked compare , per screeshot below.

Nancy

As I said in my initial post, this does work fine in the BAQ designer. The BAQ designer generates SQL code, and 1 works as a value in SQL with booleans. The query designer for BPMs looks a lot like the BAQ designer, but that operates on C#, which not only requires the “true” value for booleans, but is case-sensitive as well.

2 Likes