Inside the mind of a trigger

We know that triggers are executed when a DML operation occurs on an sObject record and that they can be executed at two points in the order of execution. All of these details have to be specified in the trigger definition, because triggers can only be executed by the platform itself. There is no way to call a trigger directly and force it to execute. Instead, you will have to write code to perform a DML operation and the Salesforce1 Platform will take care of the rest.

Let's stick with our previous business requirement of keeping the phone field on contact records in sync with the phone field on their respective accounts. To do this, we will start by creating a new trigger. As the trigger will be for DML operations ...

Get Learning Apex Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.