Book Image

Learning Apex Programming

5 (1)
Book Image

Learning Apex Programming

5 (1)

Overview of this book

Table of Contents (17 chapters)
Learning Apex Programming
Credits
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Please sir, I want some more


As customers use the Salesforce1 Platform for more business purposes, their license count increases. An increase in license count means an increase in allotted storage, which will ultimately result in an increase in records. More records means more worrying about hitting an Apex governor limit. The @future annotation is a valuable tool to have in your coding arsenal, but it is still bound by limits. As we just saw, we can find clever ways of exceeding beyond these limits, but we can't operate on an unlimited amount of data.

Fortunately for us, and you, Apex includes a Database.Batchable interface that is designed to process very large data sets. It works by breaking up your large data set into smaller batches and treating each batch as a unique transaction with its own set of limits. Based on the current Apex governor limits, our previous code that repeatedly calls the @future method will not be able to update more than 110,000 records (assuming we can even query...