2007 problem with multiple conditions

R

RyanGarcia

I had a form that worked just fine under Infopath 2003, but no longer works
in 2007.

Problem:
Two variables, call them X and Y.

I had a rule that displayed a box if X was 1 or 2 and Y was 1.

In 2003 I set three conditions in the rules setting.
If X is equal to 1 OR
If X is equal to 2 AND
If Y is equal to 1 then...

So it was being interpreted correctly...if (x == 1 || x == 2) && (y == 1)

But under 2007 it is being interpreted as ... if (x == 1) || (x == 2 && y ==
1)

So it is no longer working for all instances where X is 1 (since it's
catching more situations than I want).

How can I code this so it works in both 2003 and 2007? Breaking up into
multiple individual rules with only 2 conditions is going to be very
difficult.
 
G

Greg Collins [InfoPath MVP]

IP07 is correct. AND should take first precedence over OR.

You can use the boolean() method to manually enter your conditions.

boolean((x = 1 or x = 2) and y = 1)
 
G

Greg Collins [InfoPath MVP]

I understand your pain! It is unfortunate it was incorrectly evaluating the expression in IP03.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top