O'Reilly logo

Learning Apex Programming by Matt Kaufman, Michael Wicherski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required