Where we're going, we don't need roads

In Chapter 2, Apex Limits, we looked at how to write a method in Apex that will update contact numbers when the phones on their account records are modified. Then, we modified our code to operate efficiently on just the records that need to be operated upon and also added in statements to ensure we don't exceed our Apex governor limits. However, the only way to stay under the limits was to cap the number of records we operated upon, possibly leaving some records untouched. While business requirements can vary, I think it's safe to assume that no one likes it when code works only sometimes. If you need a refresher, here is the method we wrote:

//A common pattern for triggered operations in Apex public static ...

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.