Skip to content

Scheduling Exports

You can schedule exports to run automatically on a regular basis.

The scheduled export requires additional options. To this end, you set up the export to be executed with additional parameters.

The following parameters are available:

Parameter Possible Values Description Example Values
Interval x(d|w|m) Specifies the export period, where x is an integer, d=day, w=week, m=month.
Defaults to 1m.
2w
x-y x and y are positive integers (1 .. 31), where x-y specifies a day range for a month. If x>y, then x is considered a day of the previous month. 1-15
Alignment previous, current or next Used to describe the Interval position relative to the execution time.
Interval = 1m and Alignment = next means that the export period is the next month.
Interval = -3m (negative value) and Alignment = current means that the export period is the current and the last two months.
Interval = 1w and Alignment = previous means that the export period is the previous week.
If not set, defaults to previous.
next
ShiftDays x Optional. Usually, the time period calculation is based on the current date. This integer specifies a number of days by which the "anchor date" is to be moved backward or forward. -5
StartOfWeek 1 .. 7 Optional. Specifies the start day of the week, with 1 = Monday ... 7 = Sunday. Defaults to 1 if left empty. 1
ExportSettings comma-separated list of export setting names Specifies which export settings are processed when the export runs. MyCsvExport1, MyCsvExport2
PaymentDate (start|end)(+|-)x Optional, applicable for invoice exports only. Specifies the payment date based on the calculated start date or end date, where x is a number of days. end-5
CreatePayments false|true Optional, applicable for invoice exports only. Determines whether to create payment balances on the invoices upon exporting. Defaults to false. true
Tenants comma-separated list of tenants Optional, applicable for booking detail exports only. Specifies for which tenants the booking details are to be exported. Defaults to all tenants. Tenant1,Tenant2

Setting up a parameterized export involves two steps:

  • Defining parameters for the batch chain
  • Scheduling the batch chain: ExportChain

Configuring Export Batch Chain Parameters

  1. In Setup, open Custom Settings.

    In Salesforce Lightning, navigate to Custom Code > Custom Settings.

    In Salesforce Classic, navigate to Develop > Custom Settings.

  2. Click Manage in the row of Batch Parameters.

  3. Click New.
  4. Specify the details as required.

    • Name: Must match the Job Name to be set when scheduling the job
    • Batch Chain: ExportChain
    • Parameter 1..8: Define batch chain-specific execution options using the syntax

      <parameter> = <value>

  5. Click Save.

For details, see Scheduling Concepts and Defining Batch Parameters.

Scheduling Export Batch Chain

To schedule the batch chain, you can use either JustOn's Scheduled Jobs page or Salesforce's Schedule Apex functionality. For details, see Scheduling a Job.

Via JustOn's Scheduled Jobs page:

  1. Open the Scheduled Jobs page.

    Use the following URL https://login.salesforce.com/apex/ONB2__JobsSetup, or, if you are already logged in, append apex/apex/ONB2__JobsSetup to your org's domain name.

    As of JustOn 2.52, you can access the Scheduled Jobs page via the JustOn configuration app (App Launcher > JustOn Configuration > Jobs Setup).

  2. From the Apex Job drop-down list, select Batch Chain Job.

  3. In the Job Name field, specify the name of the batch parameters setting created before.
  4. From the Start Time drop-down list, select the preferred execution time.
  5. Click Schedule.

    This sets up the export to be executed on a regular basis at the specified time with the additional parameters set.

Info

From the Scheduled Jobs page, you can also run the batch chain immediately.

Via Salesforce's Schedule Apex functionality:

  1. In Setup, open Apex Classes.

    In Salesforce Lightning, navigate to Custom Code > Apex Classes.

    In Salesforce Classic, navigate to Develop > Apex Classes.

  2. Click Schedule Apex on top of the list.

  3. Specify the details as required.

    • Job Name: The name of the batch parameters setting created before
    • Apex Class: ScheduledBatchChain
    • Frequency
    • Start
    • End
    • Preferred Start Time
  4. Click Save.

    This sets up the export to be executed on a regular basis at the specified time with the additional parameters set.

For more details about job scheduling, see Scheduling a Job in the JustOn documentation and Schedule Apex in the Salesforce Help.