4. Agenda
• What is Trigger
• Context Variable
• Before Vs After
• Demo
• Bulkify Trigger and Trigger Best Practice
• Why Framework ?
5. Some House Rules
• Mute your mic
• Keep adding questions in Zoom Q&A Window
• No question is too small
• Questions will be answered in last 15 mins
6. What is Trigger
Apex triggers enable you to perform custom actions before or after changes
to Salesforce records, such as insertions, updates, or deletions.
A trigger is Apex code that executes before or after the following types of operations:
● insert
● update
● delete
● merge
● upsert
● undelete
8. Before Vs After Trigger ?
Before
used to update or validate record
values before they are saved to
database.
After
to access field values that are set by the system (such
as a record's Id or LastModifiedDate field)
to affect changes in other records, such as logging
into an audit table or firing asynchronous events with
a queue.
The records that fire the after trigger are read-only