action.skip

Scheduling Jobs

Scheduling Concepts

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

With this respect, the following concepts are important:

Batch chain

A batch chain is a series of several linked complex operations, which are executed sequentially on multiple records (as selected from list views) at the same time.

JustOn Billing & Invoice Management ships a number of ready-to-use batch chains that cover certain business processes.

Batch parameters
Batch chains may require additional options. To this end, JustOn Billing & Invoice Management 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.
Job schedule

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.
BatchBalanceExportJob Generates booking details from payment balances
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.
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 (legacy) JustOn Self-Service Extension.
VATValidationChain Executes the VAT validation.

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

Defining Batch Parameters

Batch parameters control the execution behavior of a batch chain, a series of several linked complex operations, which are executed sequentially on multiple records (as selected from list views) at the same time.

Common parameters

Common batch chain parameters that can be used with various batch chains include:

Parameter Possible Values Description
Interval x(d|w|m) Specifies the period to be considered by the business process (invoice run, export, etc.), where x is an integer, d=day, w=week, m=month.
Defaults to 1m.
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.
Alignment previous, current or next Used to describe the Interval position relative to the execution time.
Interval = 1m and Alignment = next means that the considered period is the next month.
Interval = -3m (negative value) and Alignment = current means that the considered period is the current and the last two months.
Interval = 1w and Alignment = previous means that the considered period is the previous week.
If not set, defaults to previous.
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.
StartOfWeek 1 .. 7 Optional. Specifies the start day of the week, with 1 = Monday ... 7 = Sunday. Defaults to 1 if left empty.

You can define multiple batch parameters settings:

  1. Click to enter Setup, then 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, for example, Interval = 2w or Alignment = next
  5. Click Save.

Info

The ExportChain, 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 Billing & Invoice Management'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/ONB2__JobsSetup to your org's domain name.

    You can access the Scheduled Jobs page via the JustOn configuration app ( > 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 (see Scheduling Concepts) 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.

    Optionally, edit the displayed cron expression to adjust the execution time.

  5. Click Schedule.

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

Info

Clicking Run immediately you can execute the batch chain instantly.

Scheduling Apex Class

You can schedule a job using the standard Salesforce Schedule Apex functionality.

  1. Click to enter Setup, then 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.

  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(d|w|m) Specifies the invoice run period, where x is a positive or negative 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 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>
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>
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>
OpportunityInvoiceRunFilter <string> Specifies the name of a opportunity filter to be applied as taken from the custom setting Filters <filter name>

Info

If the calculated period and the specified filters of a scheduled invoice run belong to an existing invoice run (irrespective of whether created manually or via the scheduled job), JustOn Billing & Invoice Management adds any new invoices to the existing invoice run instead of creating a new one.

Setting up a parameterized invoice run involves two steps:

Configuring Batch Chain Parameters

  1. Click to enter Setup, then 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, for example, Interval = 2w or Alignment = next
  5. Click Save.

InvoiceRunChain parameters examples

Create invoices for the past two weeks:

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
With the default alignment setting (Alignment = previous), the invoice run period is the past 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

Create invoices for the next month one week before it starts:

Field Value Description
Name ir_schedule_2 Must match the Job Name to be set when scheduling the job
Batch Chain InvoiceRunChain
Parameter 1 Alignment = current Sets the invoice run period to the current interval period
With the default interval setting (Interval = 1m), the invoice run period is the current month.
Parameter 2 ShiftDays = 7 Moves the time period calculation seven days forward (so that current actually starts one week earlier)
Parameter 3 InvoiceRunFilter = MySubscriptions Sets the invoice run filter to MySubscriptions, 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/ONB2__JobsSetup to your org's domain name.

    You can access the Scheduled Jobs page via the JustOn configuration app ( > 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.

    Your business may require to schedule multiple invoice runs. In order to prevent concurrent access to records or batch job limitations, they should, however, not run in parallel. Therefore, JustOn recommends to involve a certain time delay between the scheduled invoice runs – for example, one at 00:00, the next at 01:00, and so on. The interval may vary depending on the amount of records to be processed.

  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. Click to enter Setup, then 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.

    Your business may require to schedule multiple invoice runs. In order to prevent concurrent access to records or batch job limitations, they should, however, not run in parallel. Therefore, JustOn recommends to involve a certain time delay between the scheduled invoice runs – for example, one at 00:00, the next at 01:00, and so on. The interval may vary depending on the amount of records to be processed.

  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. Click to enter Setup, then 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 Note Example Values
ExportSettings comma-separated list of export setting names Specifies which export configuration settings for invoices or booking details are processed when the export runs. Mandatory MyCsvExport1, MyCsvExport2
Interval x(d|w|m) Specifies the export period, where x is an integer, d=day, w=week, m=month.
To avoid Salesforce database errors, make sure to execute the invoice export at most once a day.
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.
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. Optional -5
StartOfWeek 1 .. 7 Specifies the start day of the week, with 1 = Monday ... 7 = Sunday. Defaults to 1 if left empty. Optional 1
PaymentDate (start|end)(+|-)x Specifies the payment date based on the calculated start date or end date, where x is a number of days. Optional, applicable for invoice exports only end-5
CreatePayments false|true Determines whether to create payment balances on the invoices upon exporting. Defaults to false. Optional, applicable for invoice exports only true
BusinessEntities comma-separated list of business entities Specifies for which business entities the booking details are to be exported. Defaults to all business entities.
For compatibility reasons, JustOn supports the parameter name Tenants.
Optional, applicable for booking detail exports only EMEA,APAC

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. Click to enter Setup, then 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, for example, Interval = 2w or Alignment = next

      To avoid Salesforce database errors, make sure to execute the invoice export at most once a day.

  5. Click Save.

ExportChain parameters example

Export invoices of the current week:

Field Value Description
Name week_exp_schedule Must match the Job Name to be set when scheduling the job
Batch Chain ExportChain
Parameter 1 Interval = 1w Sets the invoice run period to one week
Parameter 2 Alignment = current Sets the invoice run period to the current interval period
Parameter 3 ExportSettings = OpenInvCSVExport Applies the export configuration settings OpenInvCSVExport, which must be defined in Export Settings

Use a corresponding cron expression to schedule the export for a specific day of the week. If you want, for example, to export the invoices every Saturday night at 23:00, use 0 0 23 ? * 7.

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/ONB2__JobsSetup to your org's domain name.

    You can access the Scheduled Jobs page via the JustOn configuration app ( > 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.

    If you schedule multiple exports, make sure to set different execution times. Concurrently executing multiple instances of the export batch chain may produce errors.

Info

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

Via Salesforce's Schedule Apex functionality:

  1. Click to enter Setup, then 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

      To avoid Salesforce database errors, make sure to execute the invoice export at most once a day.

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

    If you schedule multiple exports, make sure to set different execution times. Concurrently executing multiple instances of the export batch chain may produce errors.

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/ONB2__JobsSetup to your org's domain name.

    You can access the Scheduled Jobs page via the JustOn configuration app ( > 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. Click to enter Setup, then 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/ONB2__JobsSetup to your org's domain name.

    You can access the Scheduled Jobs page via the JustOn configuration app ( > 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 configured subscription price increase 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. Click to enter Setup, then 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 configured subscription price increase 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 built 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.

Note

The subscription build job always processes all available subscription build filters. Be aware that this may, consequently, produce multiple subscriptions for an account.

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/ONB2__JobsSetup to your org's domain name.

    You can access the Scheduled Jobs page via the JustOn configuration app ( > JustOn Configuration > Jobs Setup).

  2. From the Apex Job drop-down list, select Subscription Builder Job.

    The Job Name field is automatically set to SubscriptionBuilderChain.

  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 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. Click to enter Setup, then 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 Salesforce Developer Console:

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 with the use case Transaction 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. Click to enter Setup, then 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

      TransactionFilters = 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/ONB2__JobsSetup to your org's domain name.

    You can access the Scheduled Jobs page via the JustOn configuration app ( > 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. Click to enter Setup, then 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/ONB2__JobsSetup to your org's domain name.

    You can access the Scheduled Jobs page via the JustOn configuration app ( > 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. Click to enter Setup, then 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 Payment Bookkeeping Data Generation

Creating booking details from payment balances on a regular basis requires a job that calls the appropriate batch process BatchBalanceExportJob provided by JustOn Billing & Invoice Management.

Info

Be aware of the following specifics:

  • JustOn recommends to schedule the payment bookkeeping data job for daily execution.

    By default, JustOn generates booking details for balances that have been created or modified in the past eight days (according to the SystemModstamp information). This is why the payment bookkeeping data job must run at least once per week, otherwise it does not detect all new, changed or deleted balances. The detection of deleted balances is improved if they are still available in the recycle bin. If you delete balances on a regular basis, you must align the operations for creating payment bookkeeping data and emptying the recycle bin.

    You can, however, overwrite the default period of past eight days using a dedicated batch parameter setting, see Overwriting Default Period.

  • For the payment bookkeeping data creation to work, the global setting Create Bookkeeping Data must be selected.

  • The payment bookkeeping data creation supports the custom Account field ON_DebtorNo. The debtor number is used as the primary bookkeeping account number for a payment booking detail, see Assigning Bookkeeping Accounts.
  • The payment bookkeeping data creation supports the custom Balance field ON_ProviderFee for calculating the payment provider fees based on your payment provider contract. If the field is not available or empty, JustOn uses the standard Provider Fee field, see Handling Provider Fees.

Overwriting Default Period

The payment bookkeeping data creation job allows for an optional parameter that overwrites the default period to consider balance modifications. If, for example, the job executions uses too much resources because of a large number of balances to process, you can set a shorter period to consider and, consequently, adjust the execution interval for the payment bookkeeping data job accordingly.

To overwrite the default period of relevant balance modifications, you create a specific batch parameters setting for the payment bookkeeping data creation job.

  1. Click to enter Setup, then 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: BatchBalanceExportJob

      Using the original batch chain name overwrites the default settings.

    • Batch Chain: BatchBalanceExportJob

    • Parameter 1: Period, an integer that specifies the required number of past days to consider balance modifications (according to the SystemModstamp information)

      Assuming you want to consider the balance modifications of the past three days, set

      Period = 3
      
  5. Click Save.

Scheduling Export Balances Job

To schedule the payment bookkeeping data creation 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/ONB2__JobsSetup to your org's domain name.

    You can access the Scheduled Jobs page via the JustOn configuration app ( > JustOn Configuration > Jobs Setup).

  2. From the Apex Job drop-down list, select Export Balances Job.

    The Job Name field is automatically set to BatchBalanceExportJob.

  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 payment bookkeeping data creation 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. Click to enter Setup, then 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: BatchBalanceExportJob
    • Frequency
    • Start
    • End
    • Preferred Start Time
  4. Click Save.

    This sets up the payment bookkeeping data creation 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 Unbilled Revenue Data Generation

To create unbilled revenue bookkeeping data based on subscriptions, you schedule the Unbilled Revenue Job.

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

Info

JustOn recommends to execute the unbilled revenue data creation as early as possible on the first day of each month.

To schedule the unbilled revenue 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/ONB2__JobsSetup to your org's domain name.

    You can access the Scheduled Jobs page via the JustOn configuration app ( > JustOn Configuration > Jobs Setup).

  2. From the Apex Job drop-down list, select Unbilled Revenue Job.

    The Job Name field is automatically set to ScheduledSubscriptionBooking.

  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 unbilled revenue data 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. Click to enter Setup, then 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: ScheduledSubscriptionBooking
    • 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 unbilled revenue data 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 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/ONB2__JobsSetup to your org's domain name.

    You can access the Scheduled Jobs page via the JustOn configuration app ( > 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. Click to enter Setup, then 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 (via the legacy JustOn Self-Service Extension) with support for pre-authorized payment transactions.

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/ONB2__JobsSetup to your org's domain name.

    You can access the Scheduled Jobs page via the JustOn configuration app ( > 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. Click to enter Setup, then 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 Subscription Metric Generation

To create or update both subscription metrics and account metrics, you schedule the subscription metric builder job.

The subscription metric builder job does not require additional parameters. That is, you can set up the job directly for the corresponding Apex class BatchSubscriptionMetricBuilderJob. For details, see Scheduling Concepts.

To schedule the subscription metric builder 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/ONB2__JobsSetup to your org's domain name.

    You can access the Scheduled Jobs page via the JustOn configuration app ( > JustOn Configuration > Jobs Setup).

  2. From the Apex Job drop-down list, select Subscription Metric Builder Job.

    The Job Name field is automatically set to BatchSubscriptionMetricBuilderJob.

  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 subscription metric 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. Click to enter Setup, then 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: BatchSubscriptionMetricBuilderJob
    • 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 metric 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 VAT Validation

You can set up a job in order to have VAT numbers validated automatically on a regular basis. To schedule the VAT validation, you can use either JustOn's Scheduled Jobs page, Salesforce's Schedule Apex functionality or the Salesforce Developer Console. 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/ONB2__JobsSetup to your org's domain name.

    You can access the Scheduled Jobs page via the JustOn configuration app ( > JustOn Configuration > Jobs Setup).

  2. From the Apex Job drop-down list, select VAT Validation Job.

    The Job Name field is automatically set to BatchVATValidationJob.

  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 VAT validation to be executed at the specified time. For accounts to be considered by the job, the VAT number source field (VATIN or ON_VATNumber) must not be empty.

Info

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

Via Salesforce's Schedule Apex functionality:

  1. Click to enter Setup, then 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: VATValidationChain
    • Apex Class: VATValidationChain
    • 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 VAT validation to be executed at the specified time. For accounts to be considered by the job, the VAT number source field (VATIN or ON_VATNumber) must not be empty.

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 VAT validation using the following code in the Salesforce Developer Console:

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

Scheduling IVA Creation

You can set up an IVA creation job in order to automatically apply individual value adjustments to overdue invoices on a regular basis.

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

To schedule the IVA creation 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/ONB2__JobsSetup to your org's domain name.

    You can access the Scheduled Jobs page via the JustOn configuration app ( > JustOn Configuration > Jobs Setup).

  2. From the Apex Job drop-down list, select IVA Creation Job.

    The Job Name field is automatically set to ScheduledIvaRun.

  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 IVA booking detail creation 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. Click to enter Setup, then 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: ScheduledIvaRun
    • 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 IVA booking detail creation 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.