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

Building skynet

Triggers that call batch processes are fairly common, but like we mentioned earlier, it's not a good practice to have two sets of code that perform the same function. Sometimes, it's just easier to have your batch process run nightly (or on some other regular basis). This ensures that you start the day fresh with a clean slate and a database full of accurate data. A fairly new method in Apex is now available that lets you schedule the execution of a batch class called System.scheduleBatch(). The System.scheduleBatch() method has four input parameters:

  • Apex class: This is the Apex class that implements the Database.Batchable interface.
  • Job name: This is a string you use for easy reference.
  • Minutes from now: This represents an integer ...

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