+ Start a Discussion
Arun battulaArun battula 

Trigger.oldMap is note giving me old values


Thanks to you all for the response in advance,

I am not getting old values in my trigger when i use the trigger.oldMap, instead I am getting new values itself

trigger LP_EventAfterTrigger on Event (After insert,After Update) {
    for(Event evtRec:trigger.new){
        if(trigger.oldMap.get(evtRec.Id).WhoCount !=evtRec.WhoCount){
                  system.debug(evtRec.EventWhoIds+' Difference '+ trigger.oldMap.get(evtRec.Id).EventWhoIds);

can please someone help
Hi Arun,

Here are some possible reasons:
  1. For which event (Insert or Update) you are checking the old values. Old values doesn't exist during insert operation. 
  2. Are you changing WhoCount in update operation? If yes then you should receive value isn your system.debug statement.

Gulshan Raj