+ Start a Discussion
Adam StaronAdam Staron 

passing variable to SOSL find query

Hi guys I want to use the SOSL to pass a variable inside the FIND query but I have no idea how to do that and if its even possible doing it that way. Here for example -
 
conn.query("Select {user variable here} IN ALL FIELDS RETURNING Account(Name), Lead(Id, Name)",
        function (err, res) {
            if (err) { return console.error(err); }
            console.log(res);
        }
    );
Any tips on how I can get around that?

Thank you very much for your time :) 
 
PriyaPriya (Salesforce Developers) 

Hey Adam,

Kindly refer this example :- 
https://developer.salesforce.com/forums/?id=906F00000005FeAIAU

If this helps kindly mark it as the best answer.

Thank you,

Priya Ranjan