Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can someone please explain what the following query does..?

    List<List<sObject>> results = [FIND '4155557000' IN Phone FIELDS 
RETURNING Contact(Id, Phone, FirstName, LastName),
Lead(Id, Phone, FirstName, LastName), Account(Id, Phone, Name)];
share|improve this question
up vote 3 down vote accepted

The query will search for the number '4155557000' in the phone field of the Contact,Lead and Account objects. The Returning clause expresses which objects need to be searched, and what fields of any matched records should be returned as results.

The composition and meaning of SOSL is well explained in its documentation

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.