Take the 2-minute tour ×
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 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
add comment

1 Answer

SOSL supports traversing relationship query .

I remember we discussed same in community.

Here is the link of community

http://boards.developerforce.com/t5/Apex-Code-Development/Can-we-have-relationships-in-a-SOSL-Query/td-p/435981

List<List<SObject>> searchList = [FIND :mySearchText IN ALL FIELDS 
                          RETURNING 
                             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 Kumar Dec 7 '12 at 17:47
add comment

Your Answer

 
discard

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.