I have 3 objects, Object A, Object B and Object C. Object B is a child of Object A, while Object C is a child of object B. I am trying to access the all the single earliest records of all records in Object C that are related to object A through object B through SOQL code. Any clues? Here are some of the SOQL queries I've come up with but they only get the earliest single record from Object C related to Object B
Object A -> Object B -> Object C
EarliestRecordsObjectCOnly = [SELECT Name, ObjectB__c, Meeting_Date__c FROM ObjectC__c WHERE ObjectB__c =:id ORDER BY Meeting_Date__c ASC LIMIT 1];
//these SOQL queries get the earliest single record from Object C related to Object B
Tried the SOQL code below and I get the error that Didn't understand relationship 'ObjectC__c' in field path
EarliestRecordsObjectCOnly = [SELECT Id, (SELECT ObjectB__c, Meeting_Date__c FROM ObjectC__c WHERE ObjectB__c.ObjectA__c =:id ORDER BY Meeting_Date__c ASC LIMIT 1) FROM ObjectA__c];
Any ideas? Let me know if there I need to be clearer. Thanks in advance