I have the next problem, when I get the output susc
I get the next line:
12:59:48:144 USER_DEBUG [32]|DEBUG|Susc: DopplerListSubscriber__c:{Id=a0246000001nTMeAAM, Contact__c=00346000002O4YvAAK, DopplerList__c=a0046000001OvCGAA0}
The issue comes here, when I need to access this iterated List and read the fieldnames Contact__c
without adding in an explicit way the fieldname to the susc.Contact__c
call.
Here is the code:
Map<String, String> LookupFieldsMap = DopplerListCriteriasUtil.getAvailableLookupObjects();
// Build query with the availableLookups and Fields Mapping
List<DopplerListSubscriber__c> sobjList = Database.query(DopplerSQLBuilder.buildSOSQLDopplerListSubscriber(listId));
Map<String, String> dopplerWrapper = new Map<String, String>();
for (DopplerListSubscriber__c susc : sobjList) {
for (String loField : LookupFieldsMap.values()) {
System.debug('Susc: ' + susc);
System.debug('LookupFields: ' + loField);
}
}
How can I access the susc item List Array to get the fields without naming them, since if I do this I do see them:
String asd = susc.Contact__c;
susc.get(loField)
perhaps?00346000002O4YvAAK
not the actual field name:Contact__c. I made the same test
loField
and in case both fieldnames are the same then do the logic.susc.getPopulatedFieldsAsMap()
then?