Skip to main content
removed incorrect answer
Source Link

You are attempting to access a list as if it is an sObject, you need to iterate over the list to first access the sObjects.

Replacing the EventRelation query and the loop, I assume this isFrom your example it's a bit hard to understand what you wantare trying to achieve:, so you may have to figure out the rest yourself.

Map<ID, EventRelation> erMap = new Map<ID, EventRelation>([SELECT Id,response,status FROM EventRelation WHERE Id IN :iMap.keySet()]); 

for(Informe_icex__c i : jobMap.values()) {
    EventRelation er = erMap.get(i.Id);
    if(er != null) {
        i.Comentarios_Invitados__c = er.response;
        i.Estado_Invitado__c = er.status;
    }
}

Also, you can't give the update statement a map. You can however just call values() which returns the list of values from a map.

update iMap.values();

You are attempting to access a list as if it is an sObject, you need to iterate over the list to first access the sObjects.

Replacing the EventRelation query and the loop, I assume this is what you want to achieve:

Map<ID, EventRelation> erMap = new Map<ID, EventRelation>([SELECT Id,response,status FROM EventRelation WHERE Id IN :iMap.keySet()]); 

for(Informe_icex__c i : jobMap.values()) {
    EventRelation er = erMap.get(i.Id);
    if(er != null) {
        i.Comentarios_Invitados__c = er.response;
        i.Estado_Invitado__c = er.status;
    }
}

Also, you can't give the update statement a map. You can however just call values() which returns the list of values from a map.

update iMap.values();

You are attempting to access a list as if it is an sObject, you need to iterate over the list to first access the sObjects.

From your example it's a bit hard to understand what you are trying to achieve, so you may have to figure out the rest yourself.

Also, you can't give the update statement a map. You can however just call values() which returns the list of values from a map.

update iMap.values();
added 563 characters in body
Source Link

You are attempting to access a list as if it is an sObject, you need to iterate over the list to first access the sObjects.

Replacing the EventRelation query and the loop, I assume this is what you want to achieve:

Map<ID, EventRelation> erMap = new Map<ID, EventRelation>([SELECT Id,response,status FROM EventRelation WHERE Id IN :iMap.keySet()]); 

for(Informe_icex__c i : jobMap.values()) {
    EventRelation er = erMap.get(i.Id);
    if(er != null) {
        i.Comentarios_Invitados__c = er.response;
        i.Estado_Invitado__c = er.status;
    }
}

Also, you can't give the update statement a map. You can however just call values() which returns the list of values from a map.

update iMap.values();

You can't give the update statement a map. You can however just call values() which returns the list of values from a map.

update iMap.values();

You are attempting to access a list as if it is an sObject, you need to iterate over the list to first access the sObjects.

Replacing the EventRelation query and the loop, I assume this is what you want to achieve:

Map<ID, EventRelation> erMap = new Map<ID, EventRelation>([SELECT Id,response,status FROM EventRelation WHERE Id IN :iMap.keySet()]); 

for(Informe_icex__c i : jobMap.values()) {
    EventRelation er = erMap.get(i.Id);
    if(er != null) {
        i.Comentarios_Invitados__c = er.response;
        i.Estado_Invitado__c = er.status;
    }
}

Also, you can't give the update statement a map. You can however just call values() which returns the list of values from a map.

update iMap.values();
Source Link

You can't give the update statement a map. You can however just call values() which returns the list of values from a map.

update iMap.values();