I have a list of strings (phones) which I'm trying to use inside my SOSL Find clause and its giving me issues:
List<String> phonesList = new List<String>();
for(Account acc : acclist) {
phonesList.add(acc.Phone);
}
System.debug(phonesList.size());
System.debug(phonesList[0]);
Until this point I can see the string, let's call it: 1112223333
When I try to use the phonesList[]
inside a SOSL like this one:
List<List<SObject>> searchList = [FIND :phonesList IN PHONE FIELDS Returning Account(Id, Name)];
I'm getting the next error in Execute Anonymous:
Specified search expression can not be converted to string
The Anonymous error line refers to the SOSL line.
Thank you for your help.
FIND {term}
it works, but not the bind, although there are examples of binding: developer.salesforce.com/docs/atlas.en-us.apexcode.meta/…val1 OR val2 OR val3 ...