+ Start a Discussion

how to write soql with unrelated object

How to find a__c ,b__c and c__c table from object  S and object P
if we do not have any direct relationship between both but Object O is having relationship with S and P.

SQOL Query ?
ANUTEJANUTEJ (Salesforce Developers) 
Hi there,

Can you try checking the below link which has a similar question, and I don't think this is possible to use soql to get unrelated objects however there is a best answer that could help you.

>> https://trailblazers.salesforce.com/answers?id=9063000000044gFAAQ

I hope this helps.

ANUTEJANUTEJ (Salesforce Developers) 
Aditionally I also found below link for fetching records which have a common parent: https://salesforce.stackexchange.com/questions/155222/fecthing-records-from-unrelated-objects-but-commonly-have-parent-object