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 – like, for example, MRR (monthly recurring revenue) or Churn (rate of discontinued subscriptions or lost revenue).
For analytics and reporting purposes, JustOn introduces specific metric objects that can be set up to track billing-relevant changes and, consequently, display previews of expected revenues: account metrics, subscription metrics and cash metrics.
Account metrics track changes to recurring or transactional items, like creation, termination, price/quantity modifications, to display the recurring revenue or growth/churn rates aggregated over all subscriptions of an account. Subscription metrics, in contrast, track the same changes in order to display the recurring revenue or growth/churn rates for individual subscriptions. Your business decides which to use:
- Your accounts may have multiple active subscriptions. If you want to display the recurring revenue or growth/churn rates aggregated over all subscriptions of an account, you use account metrics.
- If you want to display the recurring revenue or growth/churn rates for individual subscriptions, you use subscription metrics.
Last but not least, cash metrics track current changes to the amount of existing subscriptions in order to display a business's cash flow.
Info
The metric records can give valuable insights into your business by displaying the recurring revenue for the current or a future date, recurring changes (like growth or churn), or expected cash flow on a monthly basis. That is, they provide previews of expected revenues based on current subscriptions but do not track generated revenues.
In addition, you can use the metric records in order customize the JustOn reports or to build your own reports in Salesforce.
Account Metrics
Account metrics track changes to recurring or transactional items, like creation, termination, price/quantity modifications, to display the recurring revenue or growth/churn rates aggregated over all subscriptions of an account. Account metrics are related to the account and the subscription.
Info
The Account Metric object and the related functionality are available as of JustOn 2.68.
The main component is the Account Metric object, which is nearly identical to the Subscription Metric object. It holds the following information:
Account metric data model
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 metricPrevious/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 if the change date equals the start date of the first subscription. |
Is Latest (checkbox) | Marks the latest metric record for a particular item criterion. |
Item Criterion | The criterion shows which items have been aggregated to this metric. |
Items | The names of the related items 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 |
Smooth Change | The smooth change formula allows to report two consecutive metrics (within two days) as one (like -50 and +70 is reported as +20 ) |
Subscription | The first related subscription (lookup). If the metric is aggregated from multiple subscriptions, it is not specified which subscription is linked. |
Subscriptions | In case of an aggregated record, a (comma-separated) list of involved subscriptions that caused the current change. |
In addition, you can define summary fields on the account in order to calculate future MRR values. For details, see Creating Additional Account Fields.
Account metric generation
Generally, the account metric generation and the subscription metric generation are nearly identical. They use the same subscriptions and items as input and follow the same rules that trigger the metric creation.
The difference is:
- Metric data for subscription metrics is aggregated on subscription basis.
- Metric data for account metrics is aggregated on account basis, that is, for all subscriptions of an account.
The decision whether to create subscription metrics or account metrics is controlled via the global setting Subscription Metrics Scope
.
If Subscription Metrics Scope
is not set, JustOn creates subscription metrics by default.
Generally, the following item actions produce new or changed metric records:
- Creating a recurring item
- Creating a transactional item with expected revenue
-
Ending a subscription or item using an end date
You can set the end date retroactively within one month to trigger the end metric creation.
-
Deactivating an item
- Changing the price/quantity of an item
Workflow details
Subscription metric records and account metric records are created on subscription or item change if the following conditions are met:
-
Subscription
- Status is set to
Inactive
,Canceled
orUpgraded
- Status is set to
-
Recurring item
- Billing type is
Recurring
,Recurring Prorated
orRecurring Prorated AVG
- Item is created
- Quantity or price is changed
- Item is deactivated
- End date is set
- Billing type is
-
Transactional item
- Billing type is not
Recurring
,Recurring Prorated
,Recurring Prorated AVG
orOne-Time
- Item is created
- Expected revenue is changed
- Item is deactivated
- End date is set
- Billing type is not
In addition, the following rules apply:
- Each change results in a new metric record that is linked to the previous record.
- If the change date equals the start date of the first subscription, the field
Initial
is set. - Subsequent metric records have filled the fields
Previous
andChange
. - The first record is set to the start date of the item or subscription.
- Subsequent metric records are set to the next invoice date of the item.
- A final metric record for an item is created only if the end date of the item actually reached (that is, if the end date equals the current date or a previous date), or if the subscription is canceled.
- The final metric record is set to the end date of the item.
- Metrics are continued from upgraded subscriptions (related via the subscription field
Previous Subscription
).
Account metrics generation example
The metric data for account metrics is aggregated over all subscriptions of an account.
Assume the following subscription metric data from two subscriptions of one account:
Subscription sub1
:
# | Date | Actual | Change |
---|---|---|---|
1 | 7/1/2020 | 10,00 |
10,00 (positive) change |
2 | 8/1/2020 | 110,00 |
100,00 (positive) change |
3 | 9/30/2020 | 100,00 |
-10,00 (negative) change |
4 | 10/31/2020 | 0,00 |
-100,00 (negative) change |
Subscription sub2
:
# | Date | Actual | Change |
---|---|---|---|
1 | 7/1/2020 | 10,00 |
10,00 (positive) change |
2 | 9/1/2020 | 11,00 |
1,00 (positive) change |
3 | 10/31/2020 | 1,00 |
-10,00 (negative) change |
This results in the following account metrics:
# | Date | Actual | Change | Subscriptions |
---|---|---|---|---|
1 | 7/1/2020 | 20,00 |
20,00 (positive) change |
sub1,sub2 |
2 | 8/1/2020 | 120,00 |
100,00 (positive) change |
sub1 |
3 | 9/1/2020 | 121,00 |
1,00 (positive) change |
sub2 |
4 | 9/30/2020 | 111,00 |
-10,00 (negative) change |
sub1 |
5 | 10/31/2020 | 1,00 |
-110,00 (negative) change |
sub1,sub2 |
Setting up the Subscription Metric object and related functionality involves
- Configuring account metric permissions
- Enabling account metrics creation
- Creating additional account fields
- Optionally, enabling account metric list display
- Scheduling account metric generation
- Optionally, enabling additional account metric information for the metric records
Configuring Account Metric Permissions
You must manually configure the access to the Account Metric object.
-
Create a new permission set.
For details, see Create Permission Sets in the Salesforce Help.
-
Assign Read, Create and Edit permissions for the Account 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 is not required to be configured specifically.
Enabling Account Metrics Creation
Account metric generation
Generally, the account metric generation and the subscription metric generation are nearly identical. They use the same subscriptions and items as input and follow the same rules that trigger the metric creation.
The difference is:
- Metric data for subscription metrics is aggregated on subscription basis.
- Metric data for account metrics is aggregated on account basis, that is, for all subscriptions of an account.
The decision whether to create subscription metrics or account metrics is controlled via the global setting Subscription Metrics Scope
.
The global settings field Subscription Metrics Scope
contains a comma-separated list of strings that controls which metrics data is produced. The possible values include:
Value | Result |
---|---|
Subscription |
Create subscription metrics data |
Account |
Create account metrics data |
Subscription, Account |
Create both subscription metrics and account metrics data |
If Subscription Metrics Scope
is not set, JustOn creates subscription metrics by default.
-
In Setup, open Custom Settings.
In Salesforce Lightning, navigate to Custom Code > Custom Settings.
In Salesforce Classic, navigate to Develop > Custom Settings.
-
Click Manage in the row of Global Settings.
- Click Edit in the Default row.
-
In the field
Subscription Metrics Scope
, specify the intended scope.The value can be one of
Subscription
,Account
orSubscription, Account
. -
Click Save.
Info
If you have already created subscription metrics data and now also want to create account metrics data, be aware that the creation of account metrics data does not include the subscription data for which the subscription metric data has already been generated. The same applies vice-versa: Processed subscriptions are ignored if you have already created account metrics data and now modify the configuration to additionally create subscription metrics data.
In these cases, consider to recreate subscription metrics data.
Creating Additional Account Fields
Optionally, you can set up summary fields on the account in order to report future MRR values. The summary fields are not shipped with JustOn, but you can easily create them.
Label | API Name | Data Type | Description |
---|---|---|---|
Current MRR | MRR_0m__c | Currency | Shows the current MRR (based on the MRR job execution date). |
MRR in One Year | MRR_12m__c | Currency | Shows the MRR in one year (based on the MRR job execution date), taking account of the subscription end date. |
MRR in Three Years | MRR_36m__c | Currency | Shows the MRR in three years (based on the MRR job execution date), taking account of the subscription end date. |
Expected MRR in One Year | MRR_12m_f__c | Currency | Shows the expected (future contracted) MRR in one year (based on the MRR job execution date), ignoring the subscription end date if auto-renewal is enabled. |
Expected MRR in Three Years | MRR_36m_f__c | Currency | Shows the expected (future contracted) MRR in three years (based on the MRR job execution date), ignoring the subscription end date if auto-renewal is enabled. |
Info
The future contracted MRR fields show the expected revenue based on the condition that auto-renewal is enabled for the current subscription. In this case, JustOn ignores the subscription end date, providing an optimistic forecast.
If there is no auto-renewal defined, these fields act like the other MRR fields and show the same result. That is, they take account of the subscription end date, providing a realistic forecast.
The MRR summary fields are refreshed when the MRR job is executed.
The summary fields must be of the data type Currency
. The API name must use the pattern MRR_Zm__c
or MRR_Zm_f__c
, where
Z
is a positive number that represents months, likeMRR_0m__c
,MRR_12m__c
f
indicates that the field considers future contracted MRRs
To create MRR summary fields for accounts:
- Navigate to the fields list of the Account object.
-
Create the MRR summary fields as required.
For help about creating fields, see Managing Object Fields.
-
Allow the users who execute the MRR job write access to the MRR summary fields either by adding them to their assigned profiles or permission sets.
For details, see Set Field Permissions in Permission Sets and Profiles in the Salesforce Help.
-
Whitelist the MRR summary fields to make them accessible for database queries.
To this end, create new field whitelist settings for the new fields.
Enabling Account Metric List Display
Optionally, you can enable the display of related account metrics on the account page using Salesforce's related list functionality (see Work with Related Lists on Records in the Salesforce Help).
- Navigate to the object management settings of the Account object.
- Click Page Layouts.
- In the Account Layout row, click Edit.
- Select the Related Lists palette.
- Drag the Account Metrics list to the Related Lists section.
- Click Save to save the modified page layout.
For help about modifying page layouts, see Managing Pages.
Scheduling Account Metric Generation
To create or update both subscription metric and account metric records, you schedule the subscription metric builder job.
The subscription metric builder job does not require additional parameters. That is, you can set up the job directly for the corresponding Apex class BatchSubscriptionMetricBuilderJob
. For details, see Scheduling Concepts.
To schedule the subscription metric builder job, you can use either JustOn's Scheduled Jobs page or Salesforce's Schedule Apex functionality. For details, see Scheduling a Job.
Via JustOn's Scheduled Jobs page:
-
Open the Scheduled Jobs page.
Use the following URL
https://login.salesforce.com/apex/ONB2__JobsSetup
, or, if you are already logged in, appendapex/ONB2__JobsSetup
to your org's domain name.As of JustOn 2.52, you can access the Scheduled Jobs page via the JustOn configuration app (App Launcher > JustOn Configuration > Jobs Setup).
-
From the
Apex Job
drop-down list, selectSubscription Metric Builder Job
.The
Job Name
field is automatically set toBatchSubscriptionMetricBuilderJob
. -
From the
Start Time
drop-down list, select the preferred execution time. - Optionally, edit the displayed cron expression to adjust the execution time.
-
Click Schedule.
This sets up the subscription metric generation to be executed at the specified time.
Info
From the Scheduled Jobs page, you can also run the job immediately.
Via Salesforce's Schedule Apex functionality:
-
In Setup, open Apex Classes.
In Salesforce Lightning, navigate to Custom Code > Apex Classes.
In Salesforce Classic, navigate to Develop > Apex Classes.
-
Click Schedule Apex on top of the list.
-
Specify the details as required.
- Job Name
- Apex Class:
BatchSubscriptionMetricBuilderJob
- Frequency:
Weekly
orMonthly
(with an according weekday or day of month setting) - Start
- End
- Preferred Start Time
-
Click Save.
This sets up the subscription metric generation to be executed at the specified time.
For more details about job scheduling, see Scheduling a Job in the JustOn documentation and Schedule Apex in the Salesforce Help.
Enabling Additional Account Metric Information
For reporting purposes, you may wish to copy more values from an item to the resulting account metric record, for example, the product group in order to allow a corresponding grouping in the MRR reports.
-
On the Account 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 account metric upon record creation.
For help about creating fields, see Managing Object Fields.
Subscription Metrics
Subscription metrics track changes to recurring or transactional items, like creation, termination, price/quantity modifications, to display the recurring revenue or growth/churn rates for individual subscriptions. Subscription metrics are related to the account and the subscription.
Info
The Subscription Metric object and the related functionality are available as of JustOn 2.50. Aggregation support has been introduced as of JustOn 2.55.
The main component is the Subscription Metric object. It holds the following information:
Subscription metric data model
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 metricPrevious/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 if the change date equals the start date of the first subscription. |
Is Latest (checkbox) | Marks the latest metric record for a particular item criterion. |
Item Criterion | The criterion shows which items have been aggregated to this metric. |
Items | The names of the related items 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 |
Smooth Change | The smooth change formula allows to report two consecutive metrics (within two days) as one (like -50 and +70 is reported as +20 ) |
Subscription | The related subscription (primary master-detail); the metric record is deleted when the subscription is deleted. |
In addition, you can define summary fields on the subscription in order to calculate future MRR values. For details, see Creating Additional Subscription and Item Fields.
Subscription metric generation
Generally, the account metric generation and the subscription metric generation are nearly identical. They use the same subscriptions and items as input and follow the same rules that trigger the metric creation.
The difference is:
- Metric data for subscription metrics is aggregated on subscription basis.
- Metric data for account metrics is aggregated on account basis, that is, for all subscriptions of an account.
The decision whether to create subscription metrics or account metrics is controlled via the global setting Subscription Metrics Scope
.
If Subscription Metrics Scope
is not set, JustOn creates subscription metrics by default.
Generally, the following item actions produce new or changed metric records:
- Creating a recurring item
- Creating a transactional item with expected revenue
-
Ending a subscription or item using an end date
You can set the end date retroactively within one month to trigger the end metric creation.
-
Deactivating an item
- Changing the price/quantity of an item
Workflow details
Subscription metric records and account metric records are created on subscription or item change if the following conditions are met:
-
Subscription
- Status is set to
Inactive
,Canceled
orUpgraded
- Status is set to
-
Recurring item
- Billing type is
Recurring
,Recurring Prorated
orRecurring Prorated AVG
- Item is created
- Quantity or price is changed
- Item is deactivated
- End date is set
- Billing type is
-
Transactional item
- Billing type is not
Recurring
,Recurring Prorated
,Recurring Prorated AVG
orOne-Time
- Item is created
- Expected revenue is changed
- Item is deactivated
- End date is set
- Billing type is not
In addition, the following rules apply:
- Each change results in a new metric record that is linked to the previous record.
- If the change date equals the start date of the first subscription, the field
Initial
is set. - Subsequent metric records have filled the fields
Previous
andChange
. - The first record is set to the start date of the item or subscription.
- Subsequent metric records are set to the next invoice date of the item.
- A final metric record for an item is created only if the end date of the item actually reached (that is, if the end date equals the current date or a previous date), or if the subscription is canceled.
- The final metric record is set to the end date of the item.
- Metrics are continued from upgraded subscriptions (related via the subscription field
Previous Subscription
).
Subscription metrics generation example
The following example illustrates the subscription metric generation on a basic level, that is, without applying criteria. This produces a single metric chain.
There is a subscription with the start date set to 2019-01-01 and the following items:
Start and end dates trigger subscription metric record creation
Based on the given subscription items, the subscription metric builder job produces these metric records:
Produced subscription metric records
# | Event | Modification |
---|---|---|
1 | REC1 start date | 50,00 initial MRR value50,00 actual amount |
2 | REC2 start date | 270,00 (positive) change270,00 expansion value 320,00 actual amount |
3 | REC3 start date | 30,00 (positive) change30,00 expansion value350,00 actual amount |
4 | REC2 end date | -270,00 (negative) change270,00 churn value 80,00 actual amount |
5 | REC1 end date | -50,00 (negative) change50,00 churn value 30,00 actual amount |
If there are end dates set for items, JustOn produces the corresponding end metrics.
Now assume you cancel the subscription before an item end date is reached. This forces JustOn to generate one end metric record for the current metric chain that includes all items, irrespective of their end date settings.
Produced subscription metric records after cancelling the subscription
# | Event | Modification |
---|---|---|
1 | REC1 start date | 50,00 initial MRR value50,00 actual amount |
2 | REC2 start date | 270,00 (positive) change270,00 expansion value 320,00 actual amount |
3 | REC3 start date | 30,00 (positive) change30,00 expansion value350,00 actual amount |
4 | subscription end date | -350,00 (negative) change350,00 churn value0,00 actual amount |
Setting up the Subscription Metric object and related functionality involves
- Configuring subscription metric permissions
- Creating additional subscription and item fields
- Optionally, enabling subscription metric list display
- Scheduling subscription metric generation
- Optionally, enabling additional subscription metric information for the metric records
Configuring Subscription Metric Permissions
Because of the master-detail relationship with the account, you must manually configure the access to the Subscription Metric object.
-
Create a new permission set.
For details, see Create Permission Sets in the Salesforce Help.
-
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 is not required to be configured specifically.
Creating Additional Subscription and Item Fields
Subscription
Optionally, you can set up summary fields on the subscription in order to report future MRR values. The summary fields are not shipped with JustOn, but you can easily create them.
Label | API Name | Data Type | Description |
---|---|---|---|
Current MRR | MRR_0m__c | Currency | Shows the current MRR (based on the MRR job execution date). |
MRR in One Year | MRR_12m__c | Currency | Shows the MRR in one year (based on the MRR job execution date), taking account of the subscription end date. |
MRR in Three Years | MRR_36m__c | Currency | Shows the MRR in three years (based on the MRR job execution date), taking account of the subscription end date. |
Expected MRR in One Year | MRR_12m_f__c | Currency | Shows the expected (future contracted) MRR in one year (based on the MRR job execution date), ignoring the subscription end date if auto-renewal is enabled. |
Expected MRR in Three Years | MRR_36m_f__c | Currency | Shows the expected (future contracted) MRR in three years (based on the MRR job execution date), ignoring the subscription end date if auto-renewal is enabled. |
Info
The future contracted MRR fields show the expected revenue based on the condition that auto-renewal is enabled for the current subscription. In this case, JustOn ignores the subscription end date, providing an optimistic forecast.
If there is no auto-renewal defined, these fields act like the other MRR fields and show the same result. That is, they take account of the subscription end date, providing a realistic forecast.
The MRR summary fields are refreshed when the MRR job is executed.
The summary fields must be of the data type Currency
. The API name must use the pattern MRR_Zm__c
or MRR_Zm_f__c
, where
Z
is a positive number that represents months, likeMRR_0m__c
,MRR_12m__c
f
indicates that the field considers future contracted MRRs
The subscription field Last MRR Update
holds the date on which the MRR fields were last calculated.
- Navigate to the fields list of the Subscription object.
-
Create the MRR summary fields as required.
For help about creating fields, see Managing Object Fields.
-
Allow the users who execute the MRR job write access to the MRR summary fields either by adding them to their assigned profiles or permission sets.
For details, see Set Field Permissions in Permission Sets and Profiles in the Salesforce Help.
Item
By default, JustOn aggregates all items of a subscription to one metric chain. In order to separate items based on a criterion (for example, product group), you create an additional criterion field on the item. Depending on your requirements, the field can be a formula or a writable field to be filled on subscription building. The API name of the field must be MRRCriterion__c
.
Consider the following use case: You want to separate metrics by the product group as set for the item. To this end, configure the MRR criterion field as a formula and set the following content: ONB2__ProductGroup__c
. As a result, each product group has its own metric chain, and the metric field Item Criterion
specifies the product group.
- Navigate to the fields list of the Item object.
-
Create the MRR criterion field as required.
Label API Name Data Type MRR Criterion MRRCriterion__c Formula (Text)
TextFor help about creating fields, see Managing Object Fields.
-
Allow the users who execute the MRR job read access to the the
Item Criterion
field either by adding it to their assigned profiles or permission sets.For details, see Set Field Permissions in Permission Sets and Profiles in the Salesforce Help.
Info
Make sure that the user who executes the MRR job has read access to the Item Criterion
field.
Enabling Subscription Metric List Display
Optionally, you can enable the display of related subscription metrics on the subscription page using Salesforce's related list functionality (see Work with Related Lists on Records in the Salesforce Help).
- Navigate to the object management settings of the Subscription object.
- Click Page Layouts.
- In the Subscription Layout row, click Edit.
- Select the Related Lists palette.
- Drag the Subscription Metrics list to the Related Lists section.
- Click Save to save the modified page layout.
For help about modifying page layouts, see Managing Pages.
Scheduling Subscription Metric Generation
To create or update subscription metric records, you schedule the subscription metric builder job.
Note
The subscription metric builder job is available as of JustOn 2.55. Up to JustOn 2.54, subscription metrics were created by two processes that ran on subscriptions and items.
If you have updated JustOn from an earlier version, you must remove the processes and the created records, and use the job to generate new subscription metric records.
The subscription metric builder job does not require additional parameters. That is, you can set up the job directly for the corresponding Apex class BatchSubscriptionMetricBuilderJob
. For details, see Scheduling Concepts.
To schedule the subscription metric builder job, you can use either JustOn's Scheduled Jobs page or Salesforce's Schedule Apex functionality. For details, see Scheduling a Job.
Via JustOn's Scheduled Jobs page:
-
Open the Scheduled Jobs page.
Use the following URL
https://login.salesforce.com/apex/ONB2__JobsSetup
, or, if you are already logged in, appendapex/ONB2__JobsSetup
to your org's domain name.As of JustOn 2.52, you can access the Scheduled Jobs page via the JustOn configuration app (App Launcher > JustOn Configuration > Jobs Setup).
-
From the
Apex Job
drop-down list, selectSubscription Metric Builder Job
.The
Job Name
field is automatically set toBatchSubscriptionMetricBuilderJob
. -
From the
Start Time
drop-down list, select the preferred execution time. - Optionally, edit the displayed cron expression to adjust the execution time.
-
Click Schedule.
This sets up the subscription metric generation to be executed at the specified time.
Info
From the Scheduled Jobs page, you can also run the job immediately.
Via Salesforce's Schedule Apex functionality:
-
In Setup, open Apex Classes.
In Salesforce Lightning, navigate to Custom Code > Apex Classes.
In Salesforce Classic, navigate to Develop > Apex Classes.
-
Click Schedule Apex on top of the list.
-
Specify the details as required.
- Job Name
- Apex Class:
BatchSubscriptionMetricBuilderJob
- Frequency:
Weekly
orMonthly
(with an according weekday or day of month setting) - Start
- End
- Preferred Start Time
-
Click Save.
This sets up the subscription metric generation to be executed at the specified time.
For more details about job scheduling, see Scheduling a Job in the JustOn documentation and Schedule Apex 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.
-
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.
Enabling Account and Subscription Metrics on Account Basis
By default, JustOn creates account metrics and subscription metrics for all accounts. Certain circumstances may require, however, to exclude specific accounts, for example, archived accounts. To support this scenario, you can create a custom checkbox on the account that controls whether to include or exclude it on metric creation or update.
- Navigate to the fields list of the Account object.
-
Create the following new field.
API Name Data Type Description CreateMRRMetrics__c Checkbox
Formula(Checkbox)Controls whether to include ( true
) or exclude (false
) the account on metric creation or update. Using a formula, you can apply custom logic to have the checkbox selected automatically when certain conditions are met.For help about creating fields, see Managing Object Fields.
-
Allow the users who execute the MRR job read access to the
CreateMRRMetrics
checkbox field by adding it to their assigned profiles or permission sets.For details, see Set Field Permissions in Permission Sets and Profiles in the Salesforce Help.
Once created, this checkbox controls whether to include or exclude the current account on metric creation or update.
Info
If the CreateMRRMetrics
checkbox is not available, JustOn creates account metrics and subscription metrics for all accounts.
Cash Metrics
Cash metrics track current changes to the amount of existing subscriptions. They give a forecast on a business's expected cash flow based on current data rather than show the actual cash flow history.
Cash metrics are related to the account and the subscription.
Info
The Cash Metric object and the related functionality are available as of JustOn 2.52.
Cash metric data model
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 |
Workflow details
If set up accordingly, JustOn creates and updates cash metric records when relevant fields of existing subscriptions or items change.
The following conditions apply:
-
Cash metrics reflect current values and do not look back. That is, a recent cash metric record cannot reproduce previous changes to a subscription or item.
Consequently, JustOn cannot restore deleted cash metric records.
-
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
). If this field is empty, the relevant record will be ignored on metrics creation. - JustOn creates cash metrics up to the end of the subscription or item. If there is no end date, cash metric records are produced for a maximum of 12 months.
Setting up the Cash Metric object and related functionality involves
- Configuring cash metric permissions
- Optionally, enabling cash metric list display
- Creating cash metric processes
- Optionally, enabling additional cash metric information
Configuring Cash Metric Permissions
Because of the master-detail relationship with the account, you must manually configure the access to the Cash Metric object.
-
Create a new permission set.
For details, see Create Permission Sets in the Salesforce Help.
-
Assign Read, Create, Edit and Delete 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.
Enabling Cash Metric List Display
Optionally, you can enable the display of related cash metrics on the subscription page using Salesforce's related list functionality (see Work with Related Lists on Records in the Salesforce Help).
- Navigate to the object management settings of the Subscription object.
- Click Page Layouts.
- In the Subscription Layout row, click Edit.
- Select the Related Lists palette.
- Drag the Cash Metrics list to the Related Lists section.
- Click Save to save the modified page layout.
For help about modifying page layouts, see Managing Pages.
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.
Note
Depending on your use cases, the criteria for executing the processes will vary.
-
In Setup, open Process Builder.
In Salesforce Lightning, navigate to Process Automation > Process Builder.
In Salesforce Classic, navigate to Create > Workflow & Approvals > Process Builder.
-
Click New.
- Specify a (descriptive) process name.
- Set the process to start when
A record changes
. -
Configure the process as required.
Step Option Description Add Object Object The object whose modifications are to trigger the cash metrics creation, must be Subscription
orItem
Start the process The type of record change that triggers the process, must be when a record is created or edited
Add Criteria Criteria for Executing Actions The type of criteria, determines whether to check for specific field values or to evaluate records using a formula Set Conditions | Build Formula The use case-specific criteria, either the filter conditions for evaluating field values or the formula Add Action Action Type The type of action to be executed, must be Apex
Apex Class The Apex class to be executed, must be Create cash metric record on change
Set Apex Variables Invocable variables for the Apex class The id of the added/changed item/subscription
specifies the reference to the ID field of the subscription or item whose modifications are to trigger the cash metrics creation -
Click Save.
-
Click Activate.
When the defined process criteria are met, JustOn creates the cash metrics.
For help about creating processes, see Lightning Process Builder in the Salesforce Help.
Process configuration examples
You want JustOn to create cash metrics when the start date or the end date of an active subscription have changed. To this end, create the following processes:
Option | Example Value |
---|---|
The process starts when | A record changes |
Object | Subscription |
Start the process | when a record is created or edited |
Criteria for Executing Actions | Formula evaluates to true |
Build Formula | [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 |
You want JustOn to create cash metrics when billing-relevant data of an associated item have changed, including start date, end date, billing period, status, price, quantity, expected revenue, commission, discount. To this end, create the following processes:
Option | Example Value |
---|---|
The process starts when | A record changes |
Object | Item |
Start the process | when a record is created or edited |
Criteria for Executing Actions | Formula evaluates to true |
Build Formula | [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__BillingPeriod__c ) || ISCHANGED([ONB2__Item__c].ONB2__Active__c ) || ISCHANGED([ONB2__Item__c].ONB2__Price__c ) || ISCHANGED([ONB2__Item__c].ONB2__Quantity__c ) || ISCHANGED([ONB2__Item__c].ONB2__ExpectedRevenue__c ) || ISCHANGED([ONB2__Item__c].ONB2__Commission__c ) || ISCHANGED([ONB2__Item__c].ONB2__Discount__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 |
Depending on your business requirements, the criteria for executing the processes will vary. For example, you may add a condition that narrows down the set of subscriptions that are subject to the cash metrics generation.
Enabling Additional Cash Metric Information
For your individual reporting purposes, you may wish to add more information to cash metrics. Assume, for example, you want the cash metrics list view or a report to show the date of the expected cash flow. To this end, you add a custom formula field that evaluates the payment due of the subscription.
- Navigate to the fields list of the Cash Metric object.
-
Create the following new field.
Label API Name Data Type Value Due Date DueDate Formula(Date) ONB2__Date__c + ONB2__Subscription__r.ONB2__PaymentDue__c
For help about creating fields, see Managing Object Fields.
You can now proceed to include this field in the list view or a custom report in order to show the expected cash flow date.