Apex triggers
Next, to the Apex class. We use the Apex language also to create complex logic during an event. Imagine a user creates a new actor and wants to verify the actor details with an external database. You can translate this user action as the following event—after inserting an actor, make a callout to a database and add the details of the actor (such as their birthday, male/female, the color of their eyes, and so on). This means that you need to perform an action after the insertion of a record. That's what we call a trigger.
A Salesforce trigger is only executed before or after a DML operation. Yes, it can be before and after. You will learn that in The order of execution of a DML statement section. When a user inserts a new record, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access