Difference Between Trigger.new And Trigger.old In Apex?

Category: QuestionsDifference Between Trigger.new And Trigger.old In Apex?
1 Answers
Editor">Editor Staff answered 2 years ago

Trigger.new:
● This command is used for returning the list of the new forms of object records.
● We should keep in mind that the sObject list is only accessible in updating and deleting the triggers.
● Trigger.new is the command which is accessible before and after inserting, before and after the updating.
● In Trigger.new the records must be changed in before the triggers.
Trigger.old:
● This command is used for returning the list of old variants of the sObject records.
● We should keep in mind that the sObject list is only available in deleting and updating triggers.
● Trigger.old is the command that is accessible after inserting, after the update, before deleting and after updating.