I am looping trough some records and want to get the related id. This works fine as
invoice.BillingAccount__r.BillToId__c. In my case BillToId__c is a field that I get from a custom metadata setting. I tried it as a string but this is not working as:
string custMet = 'BillToId__c'; string idstr = invoice.BillingAccount__r + '.' + custMet;
I end up with the string:
How can I get the value as Id?