function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Arun battulaArun battula 

Trigger.oldMap is note giving me old values

Hi, 

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
GulshanRajGulshanRaj
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.

Thanks
Gulshan Raj