I have a custom object rstk__poline__c that has a child yo parent relationship to rstk__sylocid__c. The parent object (rstk__sylocid__c) also has a parent to child relationship with rstk__sylocnum__c.

I want to build a query that fetches all the polines (rstk__poline__c) with the their location ids (rstk__sylocid__c) and I want those location ids to also fetch the location numbers (rstk__sylocnum__c) from the parent to child relation ship.

Can you please tell me if I can achieve this in one query? I can't manage to find a solution for this. Thank you!


SOQL doesn't allow you to traverse back down in the same query. You would need to break this into two queries.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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