Skip to content

Scheduling Jobs

Scheduling Concepts

Certain business use cases require specific operations to run automatically on a regular basis. JustOn provides a number of options that facilitate process automation.

With this respect, the following concepts are important:

A batch chain is a series of multiple linked complex processes, which are executed sequentially on manageable chunks of large data sets. JustOn ships a number of ready-to-use batch chains that cover certain business processes.

Batch chains may require additional options. To this end, JustOn has introduced batch parameters, a type of custom settings that combine a batch chain with specific arguments. Consequently, you can use batch parameters to control the execution behavior of a batch chain.

Finally, you schedule a job. That is, you set up the specific Apex class ScheduledBatchChain to execute the intended batch chain at a defined interval. There are two options:

  • If your batch chain does not need additional parameters, you schedule the job directly for the batch chain.
  • If, otherwise, the batch chain requires additional parameters, you schedule the job for the specific batch parameters setting.

The following batch chains are available:

Name Parameters Required Description
AssignBalancesChain Executes a balance assignment for all open invoices.
DunningRunChain Executes a dunning run for all dunning levels and the corresponding overdue invoices.
EmailJobChain Sends queued invoices and dunnings via email.
ExportChain Exports invoices or booking details to CSV files.
InvoiceRunChain Executes an invoice run.
InvoiceStatisticsChain Updates invoice statistics for the Invoice Statistics extension.
ObjectStorageChain Archives specific objects to the JustOn Object Storage
SubscriptionBuilderChain Executes the subscription builder.
SubscriptionPriceIncreaseChain Executes a subscription price increase.
SubscriptionRenewalChain Executes a subscription renewal.
TransactionBuilderChain Executes the transaction builder.
PaymentRunChain Executes a payment collection for all open invoices if there are payment instruments available for the corresponding account.
Requires a Payment Provider Integration via the Self-Service Portal.

In a nutshell, setting up JustOn to automatically execute business processes comprises the following major tasks:

Defining Batch Parameters

Batch parameters control the execution behavior of a batch chain (see Scheduling Concepts). You can define multiple batch parameters settings:

  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: The name of the batch chain to be executed as listed in Scheduling Concepts
    • Parameter 1..8: Define batch chain-specific execution options using the syntax

      <parameter> = <value>

  5. Click Save.

Info

The InvoiceRunChain and TransactionBuilderChain require parameters.

Scheduling a Job

There are three ways to schedule a job:

Scheduling JustOn Job

You can schedule a job using JustOn's Scheduled Jobs page.

Info

The Scheduled Jobs page is available as of JustOn 2.44.

  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).

    alt text
    Scheduling a JustOn job

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

    Batch Chain Job is a user-friendly label for the ScheduledBatchChain Apex class.

  3. In the Job Name field, specify the name of the batch chain or the name of the batch parameters setting.

    For details, see Scheduling Concepts.

  4. From the Start Time drop-down list, select the preferred execution time.

  5. Optionally, edit the displayed cron expression to adjust the execution time.
  6. Click Schedule.

    This sets up the job to execute the selected batch chain at the specified time.

Scheduling Apex Class

You can schedule a job using the standard Salesforce 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.

    schedule_job
    Scheduling an Apex class

  3. Specify the details as required.

    • Job Name: The name of the batch chain or the name of the batch parameters setting (see Scheduling Concepts)
    • Apex Class: ScheduledBatchChain
    • Frequency
    • Start
    • End
    • Preferred Start Time
  4. Click Save.

    This sets up the job to execute the selected batch chain at the specified time.

For more details about Apex job scheduling, see Schedule Apex in the Salesforce Help.

Scheduling Job via the Developer Console

To schedule a batch chain, you can run the ScheduledBatchChain class in the Salesforce Developer Console, specifying the intended schedule.

  1. Open the Developer Console.

    For details, see Open the Developer Console in the Salesforce Help.

  2. Execute the following code

    ONB2.ScheduledBatchChain.setupSchedule(name, schedule);
    

    where name is the name of the batch chain or the batch parameters setting (see Scheduling Concepts) and schedule is a cron expression.

    This sets up the job to execute the selected batch chain at the specified time.

Scheduling Invoice Run

You can schedule the invoice run to have invoices created automatically on a regular basis.

Parameterized Invoice Run

The scheduled invoice run may require additional options. To this end, you can set up the invoice run to be executed with additional parameters.

The following parameters are available:

Parameter Possible Values Description Example Values
Interval x(w|m) Specifies the invoice run period, where x is an integer, 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 invoice run period is the next month.
Interval = -3m (negative value) and Alignment = current means that the invoice run period is the current and the last two months.
Interval = 1w and Alignment = previous means that the invoice run period is the previous week.
If not set, defaults to previous.
next
ShiftDays x 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 Specifies the start day of the week, with 1 = Monday ... 7 = Sunday. Defaults to 1 if left empty. 1
InvoiceDate (start|end)(+|-)x Specifies the invoice date based on the start date or end date of the invoice run, where x is a number of days. end-5
InvoiceRunFilter <string> Specifies the name of a filter to be applied as taken from the custom setting Filters <filter name>
OpportunityInvoiceRunFilter <string> Specifies the name of a opportunity filter to be applied as taken from the custom setting Filters <filter name>
TransactionFilters <string> Specifies the names of the transaction filters to be applied as taken from the custom setting Filters (comma-separated list) <filter name list>
GenericFilters <string> Specifies the names of the generic invoice run filters to be applied as taken from the custom setting Filters (comma-separated list) <filter name list>

Info

If the calculated invoice run period and the specified filters belong to an existing invoice run, then JustOn uses the existing invoice run instead of creating a new one.

Setting up a parameterized invoice run involves two steps:

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

Configuring 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: InvoiceRunChain
    • Parameter 1..8: Define batch chain-specific execution options using the syntax

      <parameter> = <value>

  5. Click Save.

InvoiceRunChain parameters example
Field Value Description
Name ir_schedule_1 Must match the Job Name to be set when scheduling the job
Batch Chain InvoiceRunChain
Parameter 1 Interval = 2w Sets the invoice run period to two weeks
Parameter 2 InvoiceDate = end-1 Sets the invoice date to the penultimate day of the invoice run period
Parameter 3 InvoiceRunFilter = MySubscriptions Sets the invoice run filter to MySubscriptions, which must be defined in Filters
Parameter 4 TransactionFilters = Cases,Orders Sets the transaction filters to Cases and Orders, which must be defined in Filters

Scheduling 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 invoice run 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 invoice run 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.

Monthly Invoice Run

You can schedule the invoice run to have invoices created automatically once a month. To do so:

  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.

    schedule_ir_job
    Scheduling the invoice run

  3. Specify the details as required.

    • Job Name
    • Apex Class: ScheduledMonthlyInvoiceRun
    • Frequency: Monthly with an according day of month setting
    • Start
    • End
    • Preferred Start Time
  4. Click Save.

    This sets up the invoice run to be executed on a regular basis at the specified time.

For the invoice run parameters, the following values are applied by default:

Invoice Run Parameter Value
Start Date Sets the first day of the month before the invoice run has been executed
End Date Sets the last day of the month before the invoice run has been executed
Invoice Date If empty, sets the date of the invoice run execution

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

Scheduling Export

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(w|m) Specifies the export period, where x is an integer, 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.

Scheduling Dunning Run Job

If your business produces large numbers of invoices, you may require to start the dunning run automatically on a regular basis. To this end, you set up a corresponding job to produce dunning reminders at regular intervals.

Info

JustOn recommends to have the dunning run job executed after the payment entry import to avoid inapplicable dunning reminders.

Handling recommendations

Once the dunning run job is scheduled, it executes at the specified time, creating a new dunning run and new dunning reminders for all configured dunning levels.

Make sure to check the produced dunning reminders on a regular base, too. JustOn recommends to finish or delete new dunning reminders as soon as possible. There should be no draft dunning reminders left at the end of the job's execution interval.

The dunning run job does not require additional parameters. That is, you can set up the job directly for the corresponding Apex class ScheduledDunningRun. For details, see Scheduling Concepts.

To schedule the dunning run job, 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 Dunning Run Job.

    The Job Name field is automatically set to ScheduledDunningRun.

  3. From the Start Time drop-down list, select the preferred execution time.

  4. Optionally, edit the displayed cron expression to adjust the execution time.
  5. Click Schedule.

    This sets up the dunning reminder generation to be executed at the specified time.

Info

From the Scheduled Jobs page, you can also run the job 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
    • Apex Class: ScheduledDunningRun
    • Frequency: Weekly or Monthly (with an according weekday or day of month setting)
    • Start
    • End
    • Preferred Start Time
  4. Click Save.

    This sets up the dunning reminder generation to be executed at the specified time.

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

Scheduling Price Increase Job

The price increase job does not require additional parameters. That is, you can set up the job directly for the corresponding batch chain SubscriptionPriceIncreaseChain. For details, see Scheduling Concepts.

To schedule the price increase 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 SubscriptionPriceIncreaseChain.
  4. From the Start Time drop-down list, select the preferred execution time.
  5. Optionally, edit the displayed cron expression to adjust the execution time.
  6. Click Schedule.

    This sets up the subscription price increase (see Configuring Subscription Price Increases) to be executed at the specified time.

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: SubscriptionPriceIncreaseChain
    • Apex Class: ScheduledBatchChain
    • Frequency: Weekly or Monthly (with an according weekday or day of month setting)
    • Start
    • End
    • Preferred Start Time
  4. Click Save.

    This sets up the subscription price increase (see Configuring Subscription Price Increases) to be executed at the specified time.

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

Scheduling Subscription Build Job

You can set up a job in order to have subscriptions build automatically on a regular basis.

The subscription build job does not require additional parameters. That is, you can set up the job directly for the corresponding batch chain SubscriptionBuilderChain. For details, see Scheduling Concepts.

To schedule the subscription build 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 SubscriptionBuilderChain.
  4. From the Start Time drop-down list, select the preferred execution time.
  5. Optionally, edit the displayed cron expression to adjust the execution time.
  6. Click Schedule.

    This sets up the subscription build to be executed at the specified time.

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: SubscriptionBuilderChain
    • Apex Class: ScheduledBatchChain
    • Frequency: Weekly or Monthly (with an according weekday or day of month setting)
    • Start
    • End
    • Preferred Start Time
  4. Click Save.

    This sets up the subscription build to be executed at the specified time.

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

You can also invoke the subscription builder using the following code in the Force.com Developer Console (see Developer Console Functionality in the Salesforce Help):

new ONB2.ChainRunner()
.execute(
    new ONB2.ChainFactory().getByName('SubscriptionBuilderChain')
);

Scheduling Automatic Transaction Build

You can set up a job in order to have transactions built automatically on a regular basis. This involves the following subtasks:

Creating Transaction Filter

  1. Create a transaction filter as necessary.

    Note that the filter name (for example, transaction1) is passed as a parameter to the batch parameters setting.

    For details, see Creating Transaction Filter.

Creating Batch Parameters Setting

To pass the transaction filter to the transaction build process, you create a specific batch parameters setting. This setting combines the batch chain to be executed (TransactionBuilderChain) with the filter as a specific execution argument.

  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: The name for the batch parameters setting, must match the name of the transaction build job, for example buildtransactions
    • Batch Chain: TransactionBuilderChain
    • Parameter 1: A parameter to be passed to the batch chain (pattern parameter = value).

      Assuming the transaction filter name is transaction1, set

      transactionfilter = transactions1
      
  5. Click Save.

Scheduling Transaction Build Job

To schedule the transaction build process, 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, for example buildtransactions.
  4. From the Start Time drop-down list, select the preferred execution time.
  5. Optionally, edit the displayed cron expression to adjust the execution time.
  6. Click Schedule.

    This sets up the transaction build process to be executed at the specified time.

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, for example buildtransactions
    • Apex Class: ScheduledBatchChain
    • Frequency: Weekly or Monthly (with an according weekday or day of month setting)
    • Start
    • End
    • Preferred Start Time
  4. Click Save.

    This sets up the transaction build process to be executed at the specified time.

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

Scheduling Balance Assignment

You can set up a job in order to have balances automatically assigned to open invoices on a regular basis.

The balance assignment job does not require additional parameters. That is, you can set up the job directly for the corresponding batch chain AssignBalancesChain. For details, see Scheduling Concepts.

To schedule the balance assignment 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 AssignBalancesChain.
  4. From the Start Time drop-down list, select the preferred execution time.
  5. Optionally, edit the displayed cron expression to adjust the execution time.
  6. Click Schedule.

    This sets up the balance assignment to be executed at the specified time.

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: AssignBalancesChain
    • Apex Class: ScheduledBatchChain
    • Frequency: Weekly or Monthly (with an according weekday or day of month setting)
    • Start
    • End
    • Preferred Start Time
  4. Click Save.

    This sets up the balance assignment to be executed at the specified time.

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

Scheduling Basware Notification Retrieval

If you distribute electronic invoices via Basware, you can set up a job in order to retrieve notifications for the processed invoices from Basware on a regular basis.

The Basware notifications job does not require additional parameters. That is, you can set up the job directly for the corresponding Apex class ScheduledBaswareNotifications. For details, see Scheduling Concepts.

To schedule the Basware notifications job, 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 Basware Notifications Job.

    The Job Name field is automatically set to ScheduledBaswareNotifications.

  3. From the Start Time drop-down list, select the preferred execution time.

  4. Optionally, edit the displayed cron expression to adjust the execution time.
  5. Click Schedule.

    This sets up the Basware notification retrieval to be executed at the specified time.

Info

From the Scheduled Jobs page, you can also run the job 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
    • Apex Class: ScheduledBaswareNotifications
    • Frequency: Weekly or Monthly (with an according weekday or day of month setting)
    • Start
    • End
    • Preferred Start Time
  4. Click Save.

    This sets up the Basware notification retrieval to be executed at the specified time.

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

Scheduling Payment Collection

You can set up a payment run job in order to automatically collect payments for open invoices on a regular basis.

Info

The payment collection requires a payment provider integration with support for pre-authorized payment transactions, exposed as future payments.

The payment run job does not require additional parameters. That is, you can set up the job directly for the corresponding batch chain PaymentRunChain. For details, see Scheduling Concepts.

To schedule the payment run 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 PaymentRunChain.
  4. From the Start Time drop-down list, select the preferred execution time.
  5. Optionally, edit the displayed cron expression to adjust the execution time.
  6. Click Schedule.

    This sets up the payment run to be executed at the specified time.

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: PaymentRunChain
    • Apex Class: ScheduledBatchChain
    • Frequency: Weekly or Monthly (with an according weekday or day of month setting)
    • Start
    • End
    • Preferred Start Time
  4. Click Save.

    This sets up the payment run to be executed at the specified time.

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

Scheduling Object Storage Archiving Operations

You can set up a job in order to have objects archived to the JustOn Object Storage automatically on a regular basis.

The scheduled archiving operations requires additional options. To this end, you set up the batch chain ObjectStorageChain to be executed with additional parameters.

The following parameters are available:

Parameter Possible Values Description Example Values
Interval x(w|m) Specifies the archiving period, where x is an integer, 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
ObjectStorageConfiguration <string> Specifies the object storage configuration that defines the archiving job type.
Must match the related custom setting name.
Archive Orders

Setting up a parameterized object storage archiving operation involves two steps:

Configuring Object Storage Chain Parameters

You create a specific batch parameters setting to pass the job type and the archiving period to the batch chain ObjectStorageChain.

  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: ObjectStorageChain
    • Parameter 1..8: Define batch chain-specific execution options using the syntax <parameter> = <value>

      Use parameter 1 to set the interval, and parameter 2 to set the object storage configuration.

  5. Click Save.

ObjectStorageChain parameters example
Field Value Description
Name objstr_archive_orders Must match the Job Name to be set when scheduling the job
Batch Chain ObjectStorageChain
Parameter 1 Interval = 1w Sets the archiving period to one week
Parameter 2 ObjectStorageConfiguration = Archive Orders Sets ObjectStorageConfiguration

Scheduling Object Storage 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 archiving operation to be executed on a regular basis at the specified time with your defined 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 archiving operation to be executed on a regular basis at the specified time with your defined parameters set.

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

Return to JustOn Administration.