Posts

Showing posts with the label Trigger context variables

Trigger Context Variables

Image
Thought of writing a article around the context variables present in triggers. Before Insert :  Trigger.new would be available as new values are being inserted into the database Trigger.old would not be available as fresh records are being inserted into the database Trigger.newMap would not be available as the record id's are not generated in before insert event Trigger.oldMap would not be available as the record id's are not generated in before insert event After Insert :  Trigger.new would be available as new values are being inserted into the database Trigger.old would not be available as fresh records are being inserted into the database Trigger.newMap would be available as the record id's are generated in after insert event Trigger.oldMap would not be available as fresh records are being inserted into the database Before Update :  Trigger.new would be available containing the updated values Trigger.old would be available containing the old val