Skip to content

Setting Up Subscription-Based Reporting

Service companies (SaaS, professional services, etc.) usually generate recurring revenue based on subscriptions with their customers. JustOn supports subscription billing with recurring and transactional (usage-based) items. Now the companies need continuous reporting about subscription-based KPIs, too - usually, MRR (monthly recurring revenue) and Churn (rate of discontinued subscriptions or lost revenue).

To enable informative reports, JustOn has introduced a metric object and relevant processes. The Subscription Metric object is related to the account, the subscription and the item, and set up to track item changes. Businesses can use the metric records in order customize the JustOn reports or to build their own reports in Salesforce.

Info

The Subscription Metric object and the corresponding processes are available as of JustOn 2.50.

Metric Data Model

The main component is the Subscription Metric object. The following fields are available:

Label API Name Data Type Description
Name Name Auto Number M-{000000000}
Account Account Master-Detail (Account) Secondary Master-Detail -> delete records on account delete
Subscription Subscription Master-Detail (Subscription) Primary Master-Detail -> delete records on subscription delete
Item Item Lookup (Item) The item which caused this change
Previous Metric PreviousMetric Lookup (Metric) Holds the id of the previous Metric record
Next Metric NextMetric Lookup (Metric) Holds the id of the next Metric record
Type Type Picklist MRR (Monthly Recurring Revenue), MRUR (Monthly Recurring Usage Revenue)
Date Date Date The effective date of the change (related to start, end or next service period of the item)
Is Final IsFinal Checkbox Marks the last metric record for ended items.
Is Latest IsLatest Checkbox Marks the latest metric record for a particular item.
Change Change Currency (16,2) The change of the MRR based on the previous MRR
Previous Previous Currency (16,2) Holds the MRR value of the previous metric record
Initial Initial Currency (16,2) Holds the initial MRR value. Only filled at the first Metric of an item.
Actual Actual Formula (Currency) Previous/Initial + Change
Churn Churn Formula (Currency) IF(Change < 0,ABS(Change),null)
Expansion Expansion Formula (Currency) IF(Change > 0,Change,null)
Churn Rate (Gross) ChurnRateGross Formula (Percent) IF(Actual=0,1,Churn/Actual)
Churn Rate (Net) ChurnRateNet Formula (Percent) IF(Actual=0,1,Change/Actual)
Growth Rate GrowthRate Formula (Percent) IF(Previous=0,null,Change/Previous)
Retention Rate RetentionRate Formula (Percent) 1-ChurnRateGross

In addition, there are two rollup summary fields on the subscription that hold the actual recurring revenue.

Label API Name Data Type Description
Monthly Recurring Revenue MRR Currency SUM over all metric records with the following condition:
(Type EQUALS Monthly Recurring Revenue) AND (Is Latest EQUALS True)
Monthly Recurring Usage Revenue MRUR Currency SUM over all metric records with the following condition:
(Type EQUALS Monthly Recurring Usage Revenue) AND (Is Latest EQUALS True)

Metric Setup

Setting up the Subscription Metric object and relevant processes involves

Configuring Permissions

Because of the master-detail relationship with the account, you must manually configure the access to the Subscription Metric object.

  1. Create a new permission set.
    For details, see Create Permission Sets in the Salesforce Help.
  2. Assign Read, Create and Edit permissions for the Subscription Metric object to the new permission set.
    For details, see Edit Object Permissions in Profiles in the Salesforce Help.

Info

Field access is already assigned via the permission set JustOn Read/Write and must not be configured specifically.

Creating Processes

The actual creation of subscription metric records is controlled by two processes that run on subscriptions and items.

Info

There are no conditions needed, the processes must just call the required Apex code.

  1. In Setup, open Process Builder.
    In Salesforce Lightning, navigate to Process Automation > Process Builder.
    In Salesforce Classic, navigate to Create > Workflow & Approvals > Process Builder.
  2. Create the following processes.
    For help about creating processes, see Lightning Process Builder in the Salesforce Help.
Option Value
Object Subscription
Start the process when a record is created or edited
Criteria for Executing Actions No criteria—just execute the actions!
Action Type Apex
Apex Class Subscription: create metric record on change
Set Apex Variables The id of the ended/canceled subscription
Field Reference: [ONB2__Subscription__c].Id
Option Value
Object Item
Start the process when a record is created or edited
Criteria for Executing Actions No criteria—just execute the actions!
Action Type Apex
Apex Class Item: create metric record on change
Set Apex Variables The id of the added/changed item
Field Reference: [ONB2__Item__c].Id

Enabling Additional Metric Information

For reporting purposes, you may wish to copy more values from an item to the resulting subscription metric record, for example, the product group in order to allow a corresponding grouping in the MRR reports.

  1. On the Subscription Metric object, create new custom fields with the same API name and data type as the fields on the item.
    For help about creating fields, see Managing Object Fields.

▶ This copies the corresponding field values to the metric upon record creation.

Workflow

Metric records are created on subscription or item change if the following conditions are met:

  • Subscription
    • Status is set to Inactive, Canceled or Upgraded
  • Recurring item
    • Billing type is Recurring or Recurring Prorated
    • Item is created
    • Quantity or price is changed
    • Item is deactivated
    • End date is set
  • Transactional item
    • Billing type is not Recurring, Recurring Prorated or One-Time
    • Item is created
    • Expected revenue is changed
    • Item is deactivated
    • End date is set

In addition, the following rules apply:

  • Each item has its own metric records.
  • Each change results in a new metric record that is linked to the previous record.
  • The first metric record has filled the field Initial.
  • Subsequent metric records have filled the fields Previous and Change.
  • The first record is set to the start date of the item.
  • Subsequent metric records are set to the next invoice date of the item.
  • The final metric record is set to the end date of the item.
  • Once a final metric record has been created, no further changes are recorded.