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 metric objects and relevant processes:

Businesses can use the metric records in order customize the JustOn reports or to build their own reports in Salesforce.

Subscription Metrics

The Subscription Metric object is related to the account, the subscription and the item, and set up to track item changes.

Info

The Subscription Metric object and the related functionality are available as of JustOn 2.50.

Data Model

The main component is the Subscription Metric object. It holds the following information:

Field Description
Account The related account (secondary master-detail); the metric record is deleted when the account is deleted.
Actual The actual amount of this metric
Previous/Initial + Change
Change The change of the MRR based on the previous MRR.
Churn Rate (Gross) The gross churn rate is the ratio between Churn and Actual.
IF(Actual=0,1,Churn/Actual)
Churn Rate (Net) The net churn rate is the ratio between Change and Actual.
IF(Actual=0,1,Change/Actual)
Churn The absolute churn if the change is negative.
IF(Change < 0,ABS(Change),null)
Date The effective date of this metric, depends on the kind of change (add/subtract) and the service period/next invoice date of the item.
Expansion The absolute expansion if the change is positive.
IF(Change > 0,Change,null)
Growth Rate The growth rate is the ratio between Change and Previous.
IF(Previous=0,null,Change/Previous)
Initial Holds the initial MRR value. Only filled in the first metric of an item.
Is Final (checkbox) Marks the final metric record after setting an end date or deactivating an item.
Is Latest (checkbox) Marks the latest metric record for a particular item.
Item The related item that caused the current change.
Next Metric Links to the next metric record, which supersedes the current record.
Previous Metric Links to the previous metric record, which is superseded by the current record.
Previous Holds the MRR value of the previous metric record.
Retention Rate The opposite of the gross churn rate. The sum of the two is always 100%.
1-ChurnRateGross
Subscription The related subscription (primary master-detail); the metric record is deleted when the subscription is deleted.
Type The type of this metric, depends on the item's type.
MRR - Monthly Recurring Revenue
MRUR - Monthly Recurring Usage Revenue

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)

Setup

Setting up the Subscription Metric object and related functionality involves

Configuring Subscription Metric 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 Subscription Metric 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.

    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

    For help about creating processes, see Lightning Process Builder in the Salesforce Help.

Enabling Additional Subscription 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.

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

    For help about creating fields, see Managing Object Fields.

Workflow

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

Cash Metrics

The Cash Metric object is related to the account and the subscription, and set up to track subscription amount changes. This way, businesses can generate reports on their cash flow.

Info

The Cash Metric object and the related functionality are available as of JustOn 2.52.

Data Model

The Cash Metric object holds the following information:

Field Description
Subscription The related subscription (primary master-detail); the metric record is deleted when the subscription is deleted.
Account The related account (secondary master-detail); the metric record is deleted when the account is deleted.
Date The effective date of this metric (month and year, always first day of a month)
Amount The sum over all items of this month for the subscription
Month The month of the effective date
Year The year of the effective date

If you want to consider, for example, the payment due of the subscription or account in your reports, you can add a custom formula field:

Label API Name Data Type Description
Due Date DueDate Formula(Date) = ONB2__Date__c + ONB2__Subscription__r.ONB2__PaymentDue__c

Setup

Setting up the Cash Metric object and related functionality involves

Configuring Cash Metric Permissions

Because of the master-detail relationship with the account, you must manually configure the access to the Cash 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 Cash 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 Cash Metric Processes

Usually, you want JustOn to run the cash metric algorithm when the subscription or a related item changes. To this end, you create dedicated processes that run on subscriptions and items.

  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.

    Option Value
    Object Subscription
    Start the process when a record is created or edited
    Criteria for Executing Actions Formula evaluates to true
    [ONB2__Subscription__c].ONB2__Account__c != null && ISPICKVAL([ONB2__Subscription__c].ONB2__Status__c , 'Active') && ( ISCHANGED([ONB2__Subscription__c].ONB2__StartDate__c ) || ISCHANGED([ONB2__Subscription__c].ONB2__EndDate__c ) )
    Action Type Apex
    Apex Class Create cash metric record on change
    Set Apex Variables The id of the added/changed item/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 Formula evaluates to true
    [ONB2__Item__c].ONB2__Subscription__c != null && ( ISCHANGED([ONB2__Item__c].ONB2__StartDate__c ) || ISCHANGED([ONB2__Item__c].ONB2__EndDate__c ) || ISCHANGED([ONB2__Item__c].ONB2__Quantity__c ) || ISCHANGED([ONB2__Item__c].ONB2__Price__c ) || ISCHANGED([ONB2__Item__c].ONB2__ExpectedRevenue__c ) || ISCHANGED([ONB2__Item__c].ONB2__Commission__c ) || ISCHANGED([ONB2__Item__c].ONB2__Discount__c ) || ISCHANGED([ONB2__Item__c].ONB2__Active__c ) || ISCHANGED([ONB2__Item__c].ONB2__BillingPeriod__c ) )
    Action Type Apex
    Apex Class Create cash metric record on change
    Set Apex Variables The id of the added/changed item/subscription
    Field Reference: [ONB2__Item__c].Id

    For help about creating processes, see Lightning Process Builder in the Salesforce Help.

Workflow

If set up accordingly, JustOn creates and updates cash metric records on subscription or item change. The following conditions apply:

  • One cash metric record corresponds to a monthly invoice run for a subscription. That is, JustOn "simulates" an invoice run per month and aggregates the amount of the resulting invoice line items for each subscription in the Amount field of the cash metric record.
  • With respect to transactional items, the monthly amount of transactional items is derived from the Expected Revenue field of the item record (ONB2__ExpectedRevenue__c).