Skip to content

Running Batches

To manually run a batch on-demand, select the “Run Batch” action button from the Batch Definition page layout.

This will appear if the image fails to load

A preview of the batch is displayed. Click the “Looks good. Start the batch” button to initiate the batch.

Note: If error messages are displayed during batch preview, check the query to make sure all fields are valid.

This will appear if the image fails to load

Scheduling Batches

Batches can be scheduled to run automatically. For example, scheduling a batch to run every Friday at 5pm.

An Apex utility is provided for scheduling. Use the Developer Console -> Debug -> Open Executable Console.

Enter Apex code:

ID batchDefinitionID = ''; // Cut and paste batch definition ID here.
rooms.BatchScheduler job = new rooms.BatchScheduler( batchDefinitionID );
// 3 pre-built frequencies defined on the utility class. Or define your own cron expression.
String frequency = rooms.BatchScheduler.WEEKLY; // DAILY or HOURLY. Custom '20 30 8 10 2 ?';
String jobID = System.schedule('Scheduled Document Batch', frequency, job);