Skip to main content
Dear All,

I am new to SFDC. I have been gudied that it is a best practicse to write an apex class and then call that class in a trigger. I want to udersatnd how we can use trigger.oldmap or trigger.newmap in an Apex class. Can anyone help me with an example or provide me a link 
4 respuestas
  1. 4 abr 2019, 06:34
    Hi Abhishek,

    Trigger.newMap - A map of IDs to the new versions of the sObject records. Note that this map is only available in before update, after insert, and after update triggers.

    Trigger.oldMap - A map of IDs to the old versions of the sObject records. Note that this map is only available in the update and delete triggers.

    Follow this link for more info:http://www.sfdc99.com/2014/02/25/comparing-old-and-new-values-in-a-trigger/

    I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

    Thanks,

    Ajay Dubedi
0/9000