I have a list of id's i want to populate their name.
This list contains account ids, contact ids, etc. Not only one sobjectType id.
I created a map that the key is the sobjectType, and the value is a list of all the id's of that type.
now i want to go over that list,generate a query for every sObject seperately, and populate the id's.
i have no idea how to do that without having the queries in a loop.
Set<Id> idsToPopulate = new Set<Id>();
Map<String, Set<Id>> idTypeToIdsMap = new Map<String, Set<Id>>();
for(field_audit_entry__c entry_i : allEntries) {
idsToPopulate.add((Id)entry_i.New_Value__c);
}
for(Id id_i : idsToPopulate) {
String idType = String.valueOf(id_i.getSobjectType());
if(!idTypeToIdsMap.containsKey(idType)){
idTypeToIdsMap.put(idType, new Set<Id>());
}
idTypeToIdsMap.get(idType).add(id_i);
}
This is what i have so far, please advise