You need to sign in to do that
Don't have an account?
MicahHoover.ax1233
Getting grandfather field associated with object in SOQL
Say my schema looks like this:
ChildObject -> ParentObject -> GrandpaObject
And there is a field GrandpaObject__c.operational_area__c I want associated with my ChildObject.
I want to be able to grab all the ChildObjects from a batch in one big query but still have access to the field in the GrandpaObject for each ChildObject.
I'm guessing I use a child-parent relationship somehow, but I haven't seen any examples like that.
Does anyone have any idea?
There are a couple of options you can try:
1) Create a custom field of type formula on Child Obj that just ouputs the value of GrandpaObject__c.operational_area__c
2) In your query itself you can reference GrandpaObject__c.operational_area__c ... Something like 'Select Name, ParentObject__r.GrandpaObject__r.operational_area__c from ChildObject'
Hope that helps answer your question