This question is related to help I received on a separate question: Get fieldnames from List.
I have since implemented this code:
for (DopplerListSubscriber__c susc : sobjList) {
Map<String,Object> fieldsPopulated = susc.getPopulatedFieldsAsMap();
System.debug(fieldsPopulated);
}
I'm getting the following debug log:
15:59:58:141 USER_DEBUG [35]|DEBUG|{Contact__c=00346000002O4YlAAK, Contact__r=Contact:{Id=00346000002O4YlAAK, Name=Jack Rogers, [email protected]}, DopplerList__c=a0046000001OvCGAA0, Id=a0246000001nTMdAAM}
The problem is, how do I access to Name
and Email
fields from the Contact__r
key? That is:
Contact__r=Contact:{Id=00346000002O4YlAAK, Name=Jack Rogers, [email protected]}