Forum Discussion
Combining 'And' with 'Or' Conditions Within a Single Trigger
Jay,
The AND is working. You can test it by making all the Topic variables false, and it won't change the state.
The reason it isn't working like you want is because SL doesn't have parenthesis. If it did, you could use them to group all the Topics together, and separate them from TakeOutTest with an AND. That way, if one Topic is true, AND TOT is true, the state is changed.
As it is, to get what you want, you need to write:
If Topic1 is true AND TOT is true OR Topic2 is true AND TOT is true OR, etc.
The ANDs group each topic (individually) with TOT. If that group is true, state is changed.
Then the ORs separate each group, so that if only one (group) is true, state is changed
Complex statements like this are evaluated by taking out the ANDs and ORs one at a time, until it has a score for the entire construction - either true or false. Two objects divided by OR evaluate to true if one (or both) are true. Two objects divided by AND must both be true to evaluate to true. In your original trigger, Topic5 and TOT are united by AND, but all the other objects are divided by OR. If any one of them is true, state is changed. Only Topic5 is joined to TOT.
Hey Walt...just wanted to say thank you again. Your explanation worked. I appreciate the assist.
Related Content
- 8 months ago
- 2 months ago
- 7 months ago
- 6 months ago