You need to sign in to do that
Don't have an account?
Beatriz Minguez
Function Parameter in SOSL code
The sSearchWord is giving me a compiling error. Can anyone tell me how to use sSearchWord in the SOSL code as a parameter?
public class ContactAndLeadSearch {
public static List<List< SObject>> searchContactsAndLeads (string sSearchWord) {
List<List<sObject>> searchList = [FIND sSearchWord IN ALL FIELDS
RETURNING Contact(FirstName,LastName), Lead(FirstName,LastName)];
Thanks,
Bea
public class ContactAndLeadSearch {
public static List<List< SObject>> searchContactsAndLeads (string sSearchWord) {
List<List<sObject>> searchList = [FIND sSearchWord IN ALL FIELDS
RETURNING Contact(FirstName,LastName), Lead(FirstName,LastName)];
Thanks,
Bea
[1] https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_SOQL_variables.htm