Skip to content

Correct SOQL syntax using AND or && in a where clause #510

Answered by jamessimone
baobao917 asked this question in Q&A
Discussion options

You must be logged in to vote

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 …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@baobao917
Comment options

@jamessimone
Comment options

Answer selected by baobao917
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants