Correct SOQL syntax using AND or && in a where clause #510
-
I know that the Child Object Where Clause field is finicky when it comes to the syntax. I am attempting to introduce to criteria in my WHERE clause. I've written it multiple ways and it just doesn't work. Below are the different examples:
None of these work. The 3rd one actually throws out an error. The first two nothing happens. When I simplify the WHERE statement to only one condition (Order_Status__c = 'Order Shipped (Complete)'), it works just fine. Guidance? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Beta Was this translation helpful? Give feedback.
The correct syntax is SOQL-compliant:
This isn't valid SOQL (let alone a sensible query!), but if you wanted to do the same thing, you'd do
condition1 AND condition 2
.In other words - the where clause doesn't work like a validation rule (where formulas and the usage of syntax like
AND(condition1, condition2)
is supported), it works like a SOQL where clause (with some limitations, and sometimes creating a formula field that evaluates to true or false would be easier, because I can't promise that I've built a fully compliant parser for where clauses).Of course, I'm trying as much as possible to support fully SOQL compliant where clause parsing, so please let me know if there's something …