Step 13: Schedule backend jobs

Learn how to schedule a backend job.

For the App to continuously synchronize data between Salesforce and Digital River, you need to schedule several backend jobs. To schedule the backend jobs:

  1. Click Setup and select Developer Console from the dropdown list. The Developer Console opens.

  2. Click Debug and select Open Execute Anonymous Window. The Enter Apex Code dialog appears.

  3. Copy the script from the first row of the table under Backend job scripts, paste it in the Enter Apex Code dialog, and click Execute. Repeat this step for each additional script in the table.

Backend job scripts

The following table lists the jobs that you need to schedule and the apex code that you can run to set up the jobs. You can also find these settings on the Schedule Jobs tab in the DR CC Config Settings spreadsheet.

Job Name

Script for Scheduled Job

Comments

Order Level Electronic Fulfillment Job

// EFN To run every 5 minute for(Integer i=0; i<60; i=i+5){ String cronTrigger = '0 ' + i + ' * ?'; String jobID = System.schedule('Job Send EFN every 5 minutes' + i, cronTrigger, new digitalriverb2b.DRB2B_ScheduleOrderLevelEFN()); System.debug('Scheduled Job ID: ' + jobID); }

Line Item Electronic Fulfillment Job

// Line Item EFN every 5 minutes for(Integer i=0; i<60; i=i+5){ String cronTrigger = '0 ' + i + ' * ?'; String jobID = System.schedule('Job Send Line Item EFN every 5 minutes' + i, cronTrigger, new digitalriverb2b.DRB2B_ScheduleLineItemEFN()); System.debug('Scheduled Job ID: ' + jobID); }

CC Subscription Processor Job

// Schedule CC Subscription Processor Job System.schedule('CC Subscription Procesor Job Hourly', '0 0 * ?', new digitalriverb2b.DRB2B_ScheduledSubscriptionProcess());

Only enable this script if you need to support subscriptions. Consult with the Digital River team before scheduling this Job.

DR Installment Subscription Processor Job

//Schedule Installment Subscription Processor Job every hour System.schedule('DR Installment Subscription Processor Job Hourly', '0 0 * ?', new digitalriverb2b.DRB2B_InstallmentSubscriptionProcessor());

Only enable this script if you need to support subscriptions. Consult with the Digital River team before scheduling this Job.