Interview Question
Qus: What are the trigger context variables?
Answers (1)
Below context variables will return either true or false.
Trigger.isBefore – returns true if the trigger context is Before Mode
Trigger.isAfter – returns true if the trigger context is After Mode
Trigger.isInsert – returns true if the trigger context is Insert
Trigger.isUpdate – returns true if the trigger context is Update
Trigger.isDelete – returns true if the trigger context is Delete
Trigger.isUndelete – returns true if the trigger context is Undelete
Trigger.isExecuting – returns true if the apex class method is getting call from Apex Trigger
Below context variables will store records at runtime.
trigger.old – stores history (old versions) of the records
trigger.oldMap – stores history (old versions) of the records along with id
trigger.new – stores new version of the records
trigger.newMap – stores new version of the records along with id