Sign up ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

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

1 Answer 1

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.