Understanding the ON Field Mechanism

Your business may require to automatically set or override certain data on subscriptions and items or on invoices and invoice line items. Think of specific information that you want to display on the final invoice, or that is necessary to make your billing process work.

To this end, JustOn features a mechanism to copy field values from source objects to subscriptions and items during subscription building or to invoices and invoice line items during invoice runs. The feature is based on custom fields whose API names start with ON_ - hence, it is referred to as ON field mechanism.

In broad outline, the ON field mechanism works as follows:

(1) You define custom fields to hold the data to be copied on any object that is the source for

This may include basic objects like Account or Product as well as specific objects like Opportunity/Opportunity Product, Order/Order Product, Case/Case Item, or any other accordingly configured (custom) object that is subject to the automatic subscription build or the invoice run.

(2) When executing the automatic subscription build or the invoice run, JustOn automatically copies the specified data to the corresponding target fields.

ON_field_intro
Transferring specific information from Salesforce/JustOn to the invoice

Implementation Details

The field values are copied if there is a corresponding field on the target object (like Sequence__c, for example). The API name of the target field must either be the same as the ON field or omit the leading ON_ (ON_Sequence__c and Sequence__c, for example, are valid target field names). The data types in the ON field and in the target field must be compatible. ON fields can be formula fields.

JustOn first tries to copy the ON field value to the target field starting with ON_. If there is no such field available, the system tries the corresponding field name without the ON_ prefix.

Subscription building and invoice generation usually involve multiple source objects, where Account and Product always are the most basic ones. They are read first. Other source objects, like, for example, Orders with Order Products or Subscriptions with Items, are input later. Be aware that their information may, consequently, override the original data. For example, if both an account and an order have the same ON field but provide different values, the value specified on the order wins.

ON_field_mechanism
Overriding ON field values upon invoice generation

Example

Think of the following example: You create invoices from opportunities, and there is a piece of information that you keep on opportunities and that is to be displayed on invoices. To this end, you create the (custom) ON field ON_Information__c on the Opportunity object, and the target field Information__c on the Invoice object. Remember that the fields must have compatible data types. When creating an invoice from an opportunity, JustOn copies the value of ON_Information__c (from the opportunity) to Information__c (on the invoice).

Now assume you involve subscriptions: You first create a subscription from the opportunity, and only then the invoice from the subscription. In this case, you create the ON field ON_Information__c on the Subscription object, too. JustOn then copies the value of ON_Information__c on the opportunity to ON_Information__c on the subscription, then from ON_Information__c on the subscription to Information__c on the invoice. Remember, however, that if the subscription gets a new value for ON_Information__c, then this data is set on the invoice, overriding the value copied from the opportunity.

Info

Using a custom placeholder, you can print the value of Information__c to the invoice PDF.

Next steps:

Automatically Building Subscriptions
Managing Invoice Runs
Billing Arbitrary Objects
Usage Data Billing

Return to JustOn Administration.