I have three object tour, tour visit and Tour Suit . In that Tour is the Parent of Tour Visit and then Tour Visit is the parent of Tour Suit, So in Tour suit there is field Call property Name , I want to retrieve the data from Tour Object Is it possible to Retrieve the Property Name through Tour Object because there is no relationship between tour and tour suit , How we can write soql query for it.

1 Answer 1


Given the information you've provided, no, it is not possible to query the Property Name from your Tour_Suit__c object (is that perhaps supposed to be Tour Suite?) when the query is based around the Tour__c object.

SOQL only allows us to query one level down a hierarchy (from Parent to Child), and you would need to query down two levels.

We can, however, query up to 5 levels upwards in a hierarchy. So if your query is based on Tour_Suit__c, you could query information about the Tour__c.

Something like SELECT Tour_Visit__r.Tour__r.Name FROM Tour_Suit__c WHERE Tour_Visit__r.Tour__c IN :tourIdList

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .