Notes
In Salesforce, a trigger is a piece of Apex code that is executed when a specific event occurs on a Salesforce record. Here are the various events on which a trigger can fire:
-
before insert
: This event fires before a new record is inserted into the database.
-
before update
: This event fires before an existing record is updated in the database.
-
before delete
: This event fires before an existing record is deleted from the database.
-
after insert
: This event fires after a new record is inserted into the database.
-
after update
: This event fires after an existing record is updated in the database.
-
after delete
: This event fires after an existing record is deleted from the database.