I'm trying to access a field from a list of sObjects which holds 3 different objects types.
List<SObject> data = new List<SObject>();
for (sObject li : data) {
String sObjName = li.Id.getSObjectType().getDescribe().getName();
system.debug(sObjName);
if(String.valueOf(sObjName) == 'CR_Contract__c'){
Month = li.End_Date__c.month(); //Cannot access End_Date__c field
MonthN = String.valueOf(month);
}
}
How can I access the field to run logic?