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.

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 I use relationships in SOSL?

Example: Find all first names that start with 'Roc' within Position__c

FIND \'Roc*\' IN ALL FIELDS RETURNING Position__c(Id, Contact__r.FirstName WHERE Title__c = 'Paper Jammer')
share|improve this question

SOSL supports traversing relationship query .

I remember we discussed same in community.

Here is the link of community

List<List<SObject>> searchList = [FIND :mySearchText IN ALL FIELDS 
                             Account (id, name,phone, BillingStreet,BillingCity,BillingState, owner.Alias,owner.MobilePhone )];
share|improve this answer
So is this only on standard relationships? not custom? – fourq Dec 7 '12 at 17:35
i think it will work for all – Mohith Shrivastava Dec 7 '12 at 17:47

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.