I have a contact in a generic sObject in apex and while I'm able to easily get detail field values using
sObject.get('MyContactField__c')
I'm not able to get fields off the related parent object, and I'm sure the related field is in memory, based on the debug logs. This returns a runtime error:
sObject.get('Account.MyAccountField__c')
with the error
Invalid field Account.MyAccountField__c' for Contact
How do I get a field value off of a parent on a generic sObject?