I wanna search for a particular string obtained by my function parameter in Contact & Lead FirstName & LastName fields..
The difficulty is how to compose a SOQL statement for that,as I am getting problem with the following piece of code:
However when I pass a string,it works perfect,it is not just allowing the parameter obtained to be passed in the query..
Am I doing something wrong?
Please let me know…
Best Answer
I'm pretty sure there's a duplicate out there somewhere, but the answer is you have to bind to the query:
Do not use the quote (') or the ({}) characters. You can bind directly to a variable.