Complex query using boolean operators
The complex query syntax that can be used to retrieve custom object records through the List records for a custom object API operation.
Custom object query currently supports the AND (&&), OR (||) and NOT (!) operators. Note that the operators are case-sensitive. You must use uppercase.
AND
-
Search for custom fields data whose
statusisactiveandactiveDateis less than2018.or
OR
-
Search for custom fields data whose
statusisactiveoractiveDateis less than2018.or
NOT
-
Search for custom fields data whose
statusis missing orstatushas a null value.or
-
Search for custom fields data whose
statusis notactive(statusis either missing or null).or
Note that to search for custom fields data where
statusexists and its value not equal toactive, use_exists_:status AND !status:active. -
Search for custom fields data with field
activeDateno less than2018(includingactiveDateis missing or null).or
Note that to search for custom fields data where
activeDateexists and its value is no less than2018, use_exists_:activeDate AND !activeDate:<2018.
Deal with the null value
The null value fields cannot be distinguished from the missing fields. Therefore, when querying by the existence of a field, it only returns the records that contain the field and the field value is not null. Query by the non-existence of one field will return the records that either miss this field or have a null value in this field.