In SOSL can I add a variable to the fields? As:
FIND {Clinica} IN Name Fields RETURNING Account(VARIABLE HERE)
Thanks
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 communityDynamic SOSL is what you need.
List<String> fields = new List<String> { 'Name' };
String term = 'FIND \'Clinica\' IN Name Fields RETURNING Account (' + String.join(fields, ',') + ')';
new List<String> { 'a', 'b', 'c', 'etc.' };
.
Dynamic SOSL
.