LogoLogo
Connectors
Salesforce B2B Commerce App 2.1.1
Salesforce B2B Commerce App 2.1.1
  • Salesforce B2B Commerce App 2.1.1
  • Introduction
    • How it works
    • What's new in version 2.1.1
    • Requirements
  • Integrating the Digital River Salesforce B2B Commerce App
    • Step 1: Install the Digital River App for Salesforce B2B
    • Step 2: Create page labels
    • Step 3: Configure the Salesforce B2B Commerce App
    • Step 4: Add custom Salesforce B2B Commerce App fields to page layouts
    • Step 5: Enable email deliverability
    • Step 6: Import ECCN codes, tax groups, and tax types
    • Step 7. Update the Product Sync settings
    • Step 8: Set up Digital River fulfillments
    • Step 9: Set up webhooks
    • Step 10: Configure CC Admin settings
    • Step 11: Configure landed cost
    • Step 12: Schedule backend jobs
    • Step 13: Manage permission sets
    • Step 14: Configure the Salesforce B2B Commerce app logs
    • Step 15: Test the Digital River Salesforce B2B Commerce app integration
  • Extending the Digital River Salesforce B2B Commerce App
    • Extend the Ship from address
    • Extend the App Webhook Framework
  • Support
  • Version number
  • Appendix
    • Fulfillment and cancellation flow
    • Issuing refunds
    • Managing regulatory fees
    • Managing subscriptions
    • Salesforce B2B Commerce App logs
    • Uploading tax certificates (US TEMS)
    • Global tax identifiers
    • VAT invoices
Powered by GitBook
On this page
  1. Integrating the Digital River Salesforce B2B Commerce App

Step 12: Schedule backend jobs

Learn how to schedule a backend job.

PreviousStep 11: Configure landed costNextStep 13: Manage permission sets

Last updated 4 years ago

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

  1. Click Setup ​ and select Developer Console from the dropdown list. The Developer window appears. ​​

  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 Batch Job Scripts and run it in the Developer console Anonymous window.

  4. Repeat Step 3 for every script in the .

‌

Batch 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. (Replace <<STOREFRONT_NAME>> with your own storefront name).

Batch Job Name

Script to Schedule Batch Job

Comments

Order Fulfillment Job

// To run every 5 minutes for(Integer i=0; i<60; i=i+5) {

String cronTrigger = '0 ' + i + ' * * * ?';

System.schedule('Order Fulfillment Job: ' + i, cronTrigger, new digitalriverv2.DRB2B_ScheduleOrderLevel_Fulfillment()); }

This job sends Order Level Fulfillment Information to Digital River. Currently, this is used only for order cancellations.

Line Item Fulfillment Job

// Run Every 5 minutes

for(Integer i=0; i<60; i=i+5){ String cronTrigger = '0 ' + i + ' * * * ?'; System.schedule('Line Item Fulfillment Job: ' + i, cronTrigger, new digitalriverv2.DRB2B_ScheduleLineItem_Fulfillment());

}

This job sends line-item level fulfillment Information to Digital River.

DR Batch Subscription Processor Job

System.schedule('DR Batch Subscription Processor Job', '0 0 * * * ?', new digitalriverv2.DRB2B_Schedule_BatchSubscriptionProcess('<<STOREFRONT_NAME>>', 'RECURR_INSTALL'));

Schedule this job to run at least once every day.

DR Recurring Payment Processor Job

Schedule System.schedule('DR Recurring Payment Processor Job', '0 0 * * * ?', new digitalriverv2.DRB2B_Schedule_RecurringPaymentProcess('RECURR_INSTALL'));

This job currently processes only 1 record at a time. Please schedule this more often in a day based on the number of installments that need to be processed.

DCM Application Logs Cleanup Job

// Run once a day. You can configure this to run more often in lower environments where Logging Level might be set to DEBUG System.schedule('DCM Application Log Cleanup Job, '0 0 0 ? * * *', new digitalriverv2.DCM_ApplicationLogCleanupJob());

This job cleans up the DCM Application logs based on the configuration “Delete Logs older than” in the Custom Metadata type digitalriverv2__DCM_Application_Log_Configuration__mdt.

batch job scripts table