Skip to content

Subscription Builder Setup Options

This document summarizes the subscription builder setup options, irrespective of your business model and your source data.

When generating subscriptions and their corresponding subscription items, the subscription builder always evaluates multiple sources in the following order:

  • specific mapping documents
  • records of accordingly configured parent-child objects
  • remote data received by a REST web service
  • preconfigured master subscriptions

Thanks to this approach, you can combine multiple sources, providing the corresponding setup.

Info

For an introduction to the subscription builder and details about how to set it up, see Automatically Building Subscriptions.

ON Fields on Objects

The subscription builder requires a number of ON fields on objects if you

For target objects (with master subscriptions) and parent objects (of a parent-child relationship), the following fields are available:

API Name Required Data Type Description
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).
ON_Subscription Lookup (Subscription) Links to the related subscription.
ON_SubscriptionBuildError Text (255) Shows the error message in case the subscription creation has failed.
ON_MasterSubscription () Text (255)
or
Formula (Text)
Required when using a master subscription. Specifies the name of the master subscription.
If configured as a formula field, the master subscription name is used for every record.
ON_MappingName () Text (255)
or
Formula (Text)
Specifies the name of the file that contains the field mapping definition in JSON.
If configured as a formula field, the mapping name is used for every record.
Deprecated, accessible via the Documents tab in the Salesforce Classic UI only. Use ON_MappingId instead.
When using the subscription update, either ON_MappingName or ON_Mapping is required.
ON_MappingId () Text (255)
or
Formula (Text)
Specifies the Salesforce record ID of the file that contains the field mapping definition in JSON.
If configured as a formula field, the mapping ID is used for every record.
When using the subscription update, either ON_MappingId or ON_Mapping is required.
ON_Mapping () Text Area (Long) Specifies the field mapping definition in JSON.
Takes precedence over ON_MappingId and ON_MappingName.
When using the subscription update, either ON_MappingId or ON_Mapping is required.
ON_CurrencyIsoCode () Formula (Text) Sets the subscription currency to the parent object currency if
a) you use multiple currencies and
b) the account currency differs from the parent object currency.
The formula is TEXT(CurrencyIsoCode).
ON_UseCase Text
or
Formula (Text)
or
Picklist
Defines the use case (NEW, UPGRADE, REORDER) to create or modify the subscription. If the field is missing or not set, the use case is determined automatically.
ON_ExcludeFromUpgrade Text (255) Specifies items to exclude from being cloned and moved to the new subscription during UPGRADE. Expects a comma-separated list of order numbers.
ON_RelatedSubscription Lookup (Subscription)
or
Formula (Text)
Specifies the related subscription, which can be used with the UPGRADE or REORDER use cases. This is useful if there are multiple active subscriptions available on the account.
ON_UpdateSubscription Checkbox Determines whether the already generated subscription linked by ON_Subscription is to be updated (checked). Must be set by the user or a process. After the update, the value is unchecked.
ON_LastSubscriptionUpdate DateTime Shows the time of the last update. Is set automatically when the subscription is updated.

For child objects (of a master-detail relationship), the following fields are available:

API Name Required Data Type Description
ON_OrderNo Formula (Text) Key to match source data to a subscription item, must be unique for each detail of the same master.
ON_Price () Formula (Currency) The net sales price of the item, required if the detail object is defined in subscription build filter.
ON_Quantity () Formula (Number) The quantity of the item to be invoiced, required if the detail object is defined in subscription build filter.
ON_Title () Formula (Text) The name or title of the item required if the detail object is defined in subscription build filter.
ON_StartDate Formula (Date) The service period start of the item.
ON_EndDate Formula (Date) The service period end of the item.
ON_BillingType Formula (Text)
or
Picklist
Specifies whether the object is invoiced once, on a recurring or a transactional base; possible values include One-Time, Recurring, Transactional.
ON_BillingPeriod Formula (Number) Specifies the time interval (in months) for the item to be considered in an invoice run.
ON_BillingUnit Formula (Text)
or
Picklist
Specifies the time frame (Day or Month) used for the price calculation of the billing period

Info

Depending on your use case and its requirements, you can add more fields to have them copied to the generated subscriptions. For details, see ON Field Mechanism.

ON fields are directly mapped to the subscription or item fields. Fields that are not starting with ON_ can only be referenced and used by a data mapping.

Use Cases

The subscription builder supports three different use cases for the subscription building. If the field ON_UseCase is missing or not set, the use case is determined automatically.

To illustrate the use cases, assume the following example: You sell phone contracts, and you keep track of your deals using opportunities. For each opportunity you generate a subscription, which is finally invoiced.

When you close a deal with a new customer, the new (or updated) opportunity triggers the creation of a new subscription. This is covered with the use case NEW.

Now an existing customer orders an additional service, which you add as a new opportunity product on a new opportunity. This opportunity product must become a new subscription item on the existing subscription. This is the use case REORDER - you add new subscription items, leaving the existing in place.

If, however, the customer decides to upgrade the calling plan, you must refund the amount that is already paid for the rest of the current contract term. This is where you apply the use case UPGRADE: you create a new subscription that includes items for any new products, but also credit items for products to be refunded, and the existing subscription terminates.

NEW

Creates a new subscription.

NEW is set automatically if

  • the use case is empty
  • there is no existing active subscription for the target account

REORDER

Creates new items and adds them to an existing subscription. If there is no existing subscription, it builds a new subscription.

REORDER is set automatically if

  • the use case is empty
  • there is exactly one existing active subscription for the target account
  • the start date of the new subscription is empty

UPGRADE

Creates a new subscription, sets an end date on the existing subscription and sets its status to Upgraded.

Certain items of the existing subscription are cloned and added to the new subscription:

  • the item is not already available in the new subscription
  • the item is not excluded by ON_ExcludeFromUpgrade__c (see ON Fields on Objects)
  • the item is active
  • the end date of the item is empty or after the start date of the new subscription

UPGRADE is set automatically if

  • the use case is empty
  • there is exactly one existing active subscription for the target account
  • the start date of the new subscription is not empty

If you work with multiple active subscriptions, the use cases REORDER or UPGRADE require the items to be assigned to the related subscription. To this end, set a value in the field ON_RelatedSubscription on the configured target or master object (see ON Fields on Objects). If the field is empty on the first use, the subscription builder creates a new subscription and inserts the subscription ID of the new object. In a subsequent subscription build process, the related subscription is then identified by the value in the field, and the item is assigned to the related active subscription.

Reasons for multiple active subscriptions can be:

  • doing customer business with different clients via tenants,
  • setting different payment due terms for the items (on one invoice, all items must have an identical payment due),
  • offering several invoices to a customer for specific products

Enabling Subscription and Subscription Items Update

Info

The automatic subscription update functionality is available as of JustOn 2.43.

Certain business use cases require existing subscriptions or subscription items to be updated, for example, after the value of a source object field has changed.

Enabling subscription update involves the following tasks:

  • Setting up a data mapping that defines the target fields to be updated using fieldsToUpdate (see Using Data Mapping)
  • Adding the fields ON_UpdateSubscription and ON_LastSubscriptionUpdate as well as ON_MappingName or ON_Mapping to the source object (see ON Fields on Objects)

Once set up, selecting the checkbox ON_UpdateSubscription triggers the automatic subscription update. The subscription builder "simulates" the use case NEW and copies the fields to be updated as specified in the corresponding mapping fieldsToUpdate.

After completing the update, the subscription builder deselects the checkbox ON_UpdateSubscription and sets a date in ON_LastSubscriptionUpdate.

Info

For further help with setting up the subscription builder, contact the JustOn support team.

Keeping Track of Source Records

Certain business use cases require keeping track of the source records based on which a subscription and its items have been created, for example, when updating subscriptions. To this end, there are two source fields on the item: ParentSourceId and ChildSourceId. JustOn automatically fills these fields during the subscription build process.

Once set, the fields keep track of the item's source records. This allows for unequivocally identifying multiple items with the same OrderNo. Following the subscription update example, JustOn only updates items whose values for ParentSourceId match the IDs of the parent objects.

Info

The source record tracking functionality is available as of JustOn 2.48.1.