Skip to main content

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 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);

global Database.Querylocator start(Database.BatchableContext bc){
  List<EventRelation> eRList =return Database.getQueryLocator([SELECT IdID,response Comentarios_Invitados__c,statusEventRelationId__c,Estado_Invitado__c,fecha_del_evento__c FROM EventRelationInforme_icex__c WHEREwhere Idfecha_del_evento__c>=LAST_N_DAYS:1]);
}

global INvoid execute(Database.BatchableContext BC, List<sObject> scope) {
    // Create a map for the chunk of records passed into :iMapmethod.keySet
    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;
}

}

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 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;

}

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;
}
Source Link
Jesus
  • 51
  • 2

Save error: Initial term of field expression must be a concrete SObject: LIST<EventRelation>

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 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;

}