Best Practice: JustOn for Salesforce CPQ

JustOn for CPQ integrates JustOn Billing & Invoice Management with Salesforce CPQ, the Configure, Price, Quote software from Salesforce.

Salesforce CPQ uses assets for one-time products. For recurring items, it produces contracts and CPQ subscriptions.

To allow for automatic billing, the assets as well as the CPQ subscriptions are configured to hold the required invoicing data. Consequently, JustOn for CPQ employs the generic invoice run to generate invoices from both the assets and the CPQ subscriptions.

Solution Outline

In broad strokes, the solution works as follows:

(1) Salesforce CPQ and JustOn are installed in your org.

(2) From your quotes with quote lines, you create orders with order items.

(3) For one-time products, Salesforce CPQ creates assets based on the corresponding order items. On top of the assets, you set up the generic invoice run.

(4) For recurring items, Salesforce CPQ creates contracts and CPQ subscriptions out of the corresponding orders and order items. Based on the CPQ subscriptions, you set up the generic invoice run for recurring items.

(5) With your accordingly set up CPQ solution, a new or modified quote generates a new order item, which then produces either a new asset or a new CPQ subscription - depending on the type of product involved.

(6) Using the generic invoice run, JustOn will directly produce invoice line items from the new assets or new CPQ subscription.

CPQ_integration
Integrating JustOn's advanced billing with Salesforce CPQ

Integrating the JustOn's generic invoice run with Salesforce CPQ involves at least the following configuration tasks:

Once set up as outlined, you execute the generic invoice run to create invoices from your assets and CPQ subscriptions.

Configuring Asset

The asset will be the single source object for both the invoice and the (one-time) invoice line items, as described in Single Objects. The invoicing process requires a number of ON fields on the asset:

  1. Navigate to the fields list of the source object.
  2. Create at least the following new fields.

    Field Label API Name Data Type Description
    Account ON_Account Formula (Text) Specifies the Salesforce account ID or external ID.
    The formula uses the API name of the field that links the object to the account, for example, TEXT(AccountId).
    Template ON_Template Formula (Text) Specifies the Salesforce ID of the related template.
    Service Date ON_ServiceDate Formula (Date)/
    Formula (Date/Time)
    The record will be invoiced when the date is null or within the service period of the invoice run.
    The formula return type depends on the source field.
    Invoice ON_Invoice Lookup (Invoice) The invoice that resulted from this record.
    Invoice Run ON_LastInvoiceRun Lookup (Invoice Run) Shows the last invoice run that has processed this object.
    Last Error ON_InvoiceBuildError Text (255) Shows errors that occurred during the last invoice run.
    Is Line Item ON_IsItem Formula (Checkbox)
    Checkbox
    Forces JustOn to use this object as the source for both the invoice and the invoice line items.
    Title ON_Title Formula (Text) The name or short description of the invoice line item.
    Quantity ON_Quantity Formula (Number) The quantity to be billed for this invoice line item.
    Using a formula, you can, if required, set the quantity 0 to exclude records from being invoiced if certain conditions are true.
    Assume, for example, a checkbox Billable - to exclude records where the checkbox is not selected, you can use a formula like: IF(Billable = 'false', 0 , Quantity)
    Unit Price ON_UnitPrice Formula (Currency) Either the net or gross price of one unit of this item.

    For more information, see Setting Up Single Object.

Configuring CPQ Subscription

The CPQ subscription will be the single source object for both the invoice and the (recurring) invoice line items, as described in Single Objects. As with assets, the invoicing process requires a number of ON fields on the CPQ subscription. To cover the recurring use case, however, you need additional fields that hold the specific recurring billing information:

  1. Navigate to the fields list of the source object.
  2. Create at least the following new fields.

    Field Label API Name Data Type Description
    Account ON_Account Formula (Text) Specifies the Salesforce account ID or external ID.
    The formula uses the API name of the field that links the object to the account, for example, TEXT(AccountId).
    Template ON_Template Formula (Text) Specifies the Salesforce ID of the related template.
    Service Date ON_ServiceDate Formula (Date)/
    Formula (Date/Time)
    The record will be invoiced when the date is null or within the service period of the invoice run.
    The formula return type depends on the source field.
    Invoice ON_Invoice Lookup (Invoice) The invoice that resulted from this record.
    Invoice Run ON_LastInvoiceRun Lookup (Invoice Run) Shows the last invoice run that has processed this object.
    Last Error ON_InvoiceBuildError Text (255) Shows errors that occurred during the last invoice run.
    Is Line Item ON_IsItem Formula (Checkbox)
    Checkbox
    Forces JustOn to use this object as the source for both the invoice and the invoice line items.
    Title ON_Title Formula (Text) The name or short description of the invoice line item.
    Quantity ON_Quantity Formula (Number) The quantity to be billed for this invoice line item.
    Using a formula, you can, if required, set the quantity 0 to exclude records from being invoiced if certain conditions are true.
    Assume, for example, a checkbox Billable - to exclude records where the checkbox is not selected, you can use a formula like: IF(Billable = 'false', 0 , Quantity)
    Unit Price ON_UnitPrice Formula (Currency) Either the net or gross price of one unit of this item.
    Billing Type ON_BillingType Picklist
    Formula (Text)
    Specifies the billing behavior. Supported values for recurring items include Recurring or Recurring Prorated.
    If the field does not exist or is empty, it defaults to the billing type One-Time.
    Next Service Period Start ON_NextInvoice Date Specifies the next billing date. If no value is defined, it will be substituted by the maximum of the invoice run start date, subscription start date or item start date. When the invoice is set Open, it is incremented to the current invoice line item's
    service period end date + 1 day
    Start Date ON_StartDate Date
    Formula (Date)
    The start date from which this item is active (may be empty)
    End Date ON_EndDate Date
    Formula (Date)
    The date until which this item is active (may be empty)

    For more information, see Setting Up Single Object and Configuring Recurring Items.

Info

You can set up JustOn to allow for starting the generic invoice run from a parent of the actual source object. Following the outlined solution, you can configure the Contract object to allow for invoicing all CPQ subscriptions that belong to a given contract. For details, see Enabling Invoice Run From Parent.

Creating Generic Invoice Run Filters

To define which records to include in the invoice run, you create custom filters.

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

  3. Create the following filters.

    Name Target Use Case
    CPQSubscriptions SBQQ__Subscription__c Generic
    Assets Asset Generic

    For additional information, see Creating Invoice Run Filter. For help about creating filters, see Filters.

Executing Invoice Run

Once set up, there are multiple ways to invoke the invoice creation process: