ayudad need. I want to create a batch class to update values from another object. this is my code but it is giving me this error
anyone can help? Thanks.
This is the start and execute section.
global Database.Querylocator start(Database.BatchableContext bc){
return Database.getQueryLocator([SELECT ID, Comentarios_Invitados__c,EventRelationId__c,Estado_Invitado__c,fecha_del_evento__c FROM Informe_icex__c where fecha_del_evento__c>=LAST_N_DAYS:1]);
}
global void execute(Database.BatchableContext BC, List<sObject> scope) {
// Create a map for the chunk of records passed into method.
Map<ID, Informe_icex__c> iMap = new Map<ID, Informe_icex__c>((List<Informe_icex__c>)scope);
List<EventRelation> eRList = [SELECT Id,response,status FROM EventRelation WHERE Id IN :iMap.keySet()];
for(Informe_icex__c i : jobMap.values()) {
if(!eRList.isEmpty()) {
i.Comentarios_Invitados__c = eRList.response;
i.Estado_Invitado__c = eRList.status;
}
}
update iMap;
}