I have a custom object called 'Intake_New__c' that has a lookup field to an Account object called 'Third_party__c'.
The account object 'Third_party__c' has a Hierarchy field on it called 'Parent Third Party'
Here is the detail of that field:
Now I am trying to get name of the related account's parent name so I can display in an email template like:
{!Intake_new__c.Third_Party__r.Parent.Name}
And it is not working.
I tried to do a query as follows in the console to see:
And I am seeing that it is returning [object object] instead of the Name. I need the actual name. Also please note that the resultset header says 'third_party__r.parent' and not 'third_party__r.parent.name'
What am I doing wrong?
UPDATE**: So per a suggesstion below I went and tried to do some debugging in debug console and still do not get why I am not seeing the Account Name in my debug statements.
List<Intake_New__c> thirdPartyData = [SELECT Third_Party__r.Parent.Name FROM Intake_New__c WHERE Third_Party__r.Parent.Name<>null LIMIT 100 ];
system.debug(thirdPartyData);
17:16:58:058 USER_DEBUG [4]|DEBUG|(Intake_New__c:{Third_Party__c=001E0000015hChYIAU, Id=a4k2S000000LWBKQA4}, Intake_New__c:{Third_Party__c=001E0000015hChYIAU, Id=a4k44000000Cr3oAAC}, Intake_New__c:{Third_Party__c=001E0000015hChYIAU, Id=a4k44000000Cr3pAAC}, Intake_New__c:{Third_Party__c=001E0000015hChYIAU, Id=a4k44000000CsO9AAK}, Intake_New__c:{Third_Party__c=001E0000015hChYIAU, Id=a4k44000000CsOQAA0}, Intake_New__c:{Third_Party__c=001E0000015hChYIAU, Id=a4k44000000CsOpAAK}, Intake_New__c:{Third_Party__c=001E0000015hChYIAU, Id=a4k4