Trying to do a SOSL query to find object matches for one of two variables. The following query is very simplified for easy reading. Any help is appreciated.
String queryString = 'FIND :var1 OR :var2 IN ALL FIELDS RETURNING Account(Name);
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.
Sign up to join this communityYes, you can use OR operator in SOSL as well but variable expression can't be used this way as far as I know:
This Example Works:
List<List<sObject>> l = [FIND '"Jhon" OR "Doe"'
IN Name Fields
RETURNING Account(name, phone)];