If i am trying to make a SOSL Search Query dynamic where Firstname and Lastname will be coming from remote parameter dynamically. Attached code sample is not working -
But if i make the SOSL Query as hardcode like below, It works perfectly and gives appropriate result. -
searchquery = '';
searchquery = 'FIND {"Jo*" And "Bo*"} IN Name Fields RETURNING Contact(Firstname,Lastname,Title, Account.Name, Phone, Email)';
In the above code "Jo*" is the FirstName and "Bo*" is the Lastname