Skip to content

Setting Up Revenue Metrics

To set up revenue metrics, configure the components described below. For conceptual background, refer to Revenue Metrics and KPI Metrics.

Revenue metrics compare your realized (invoiced) revenue against your expected (forecasted) revenue on a monthly basis, grouped by business entity, month, and, optionally, product category. Once set up, JustOn maintains the Revenue Reporting Period and Revenue Reporting Detail records that feed the Revenue Metrics Chart and Salesforce reports.

All amounts in revenue metrics are net values (without tax).

Prerequisites

  • JustOn Billing & Invoice Management installed in a version that ships the Revenue Metrics objects (Revenue Reporting Period, Revenue Reporting Detail).
  • The relevant business entities are configured.
  • For forecasting: a parent/child object structure (for example Order / OrderItems, or Opportunity / OpportunityLineItem) that holds the data you want to forecast from.
  • Permissions to manage custom settings, object fields, filters, and jobs.

Setting up revenue metrics involves

Once set up, you can use business reports to display the resulting metrics in easy-to-understand formats, in addition to the built-in Revenue Metrics Chart.

(1) Enabling Revenue Metrics

In order to globally enable revenue metrics, the feature must be activated in the global settings.

  1. Click to enter Setup, then open Custom Settings.

    In Salesforce Lightning, navigate to Custom Code > Custom Settings.

    In Salesforce Classic, navigate to Develop > Custom Settings.

  2. Click Manage in the row of Global Settings.

  3. Click Edit in the Default row.
  4. Select the checkbox Enable Revenue Metrics.
  5. Click Save.

    Once enabled, JustOn Billing & Invoice Management will create or update RRD and RRP records during the forecast run, invoice finalization, and fix invoices procedures.

Note

Deselecting Enable Revenue Metrics later does not delete records that already exist – it only stops new records from being created. Re-enabling resumes record creation for subsequent runs and finalizations; it does not retroactively create records for the disabled period.

(2) Setting Up Forecast Run Job

JustOn Billing & Invoice Management provides the Forecast Run Job that creates revenue reporting details of the type Forecasted (and the matching periods) from your configured source records. The job can only be started from JustOn's Scheduled Jobs page – there is no trigger for it in the regular invoicing UI.

  1. Click to access the App Launcher, and select JustOn Billing Configuration.
  2. Open the Jobs Setup tab.
  3. From the Apex Job drop-down list, select Forecast Run Job.

    The Job Name field is automatically set to ScheduledForecastRun.

  4. From the Start Time drop-down list, select the preferred execution time.

    A monthly schedule – for example at the start of each month – is typical.

  5. Optionally, edit the displayed cron expression to adjust the execution time.

  6. Click Schedule.

    This sets up the revenue metrics creation to be executed at the specified time.

Info

From the Scheduled Jobs page, you can also run the job immediately.

(3) Creating Forecast Filters

A filter with the use case Forecast tells the forecast run which source records to process. The run considers all forecast filters at once.

  1. Click to enter Setup, then open Custom Settings.

    In Salesforce Lightning, navigate to Custom Code > Custom Settings.

    In Salesforce Classic, navigate to Develop > Custom Settings.

  2. Click Manage in the row of Filters.

  3. Click New to create a new filter, or Edit to modify an existing filter.
  4. Specify the details as necessary.

    Option Description
    Use Case Forecast
    Target Object The parent object, for example Order
    Child Relation Field The API name of the child relationship that holds the forecast data, for example OrderItems
    Condition (optional) A SOQL WHERE condition that limits which parent records are in scope
  5. Click Save.

    This makes the filter immediately available.

    Repeat this step for any additional forecast object combinations you need.

Note

There is no restriction on the Condition value of a forecast filter. Make sure your condition returns exactly the records you intend to forecast.

(4) Adding Forecast Fields to Source Object

During the forecast run, JustOn Billing & Invoice Management reads a fixed set of fields – all prefixed with FC_ – from the child object configured in the filter. Add these fields to that object using exactly the API names below. Each maps to a field on the resulting RRD.

  1. Navigate to the fields list of the source object.
  2. Create the following new fields as required.

    Field API Name Data Type Required Target RRD Field Description
    FC_Amount__c Formula (Currency) Amount Net amount, typically the product of unit price and quantity. Positive → Class == Revenue; negative → Class == Deduction.
    FC_Account__c Formula (Text) Account Salesforce Account ID for this record. Typically a formula returning the Account ID from the parent (for example Opportunity.AccountId).
    FC_BusinessEntity__c Text Business Entity The business entity name. Must match an existing business entity, can be a formula or populated via a flow.
    FC_ServicePeriodStart__c Date Service Period Start Start of the service period, determines RRP assignment.
    FC_ServicePeriodEnd__c Date Service Period End End of the service period, used with the charging plan for period splitting.
    FC_ChargingPlan__c Picklist Charging Plan Controls how the amount is distributed across months (see below).
    FC_ProductCategory__c Text Product Category Optional grouping label (for example Licence, Support) used for chart filtering and aggregation.
    FC_Processed__c Checkbox Processing flag, set to true after the forecast run processes the record.
    Set it back to false to force recalculation (see Controlling Update Behavior).

    For help about creating fields, see Managing Object Fields.

Charging plan: amount distribution

FC_ChargingPlan__c controls how FC_Amount__c is spread across the service period:

Value Behavior Example: Start 01 Jan, End 31 Mar, Amount 300
(empty) One-time item, the full amount is booked in the month of FC_ServicePeriodStart__c. 1 RRD: Jan = 300
Monthly The full amount is booked for each month within the service period. 3 RRDs: Jan 300, Feb 300, Mar 300
Annual Split into 12 consecutive monthly windows starting from FC_ServicePeriodStart__c. Each window receives FC_Amount__c / 12. 12 RRDs from Jan, each = 25.00

For Annual, small rounding differences are tolerated (for example 100.00 / 12 = 8.33), since a forecast is meant to give a rough overview. If a window's day-of-month does not exist in a later month (for example the 29th in February of a non-leap year), the date is normalized to the last valid day of that month.

(5) Enabling Revenue Metrics Display

Adding Revenue Metrics Chart to Page

The Revenue Metrics Chart is a Lightning Web Component that overlays forecasted and invoiced revenue. You can add it to page of the types App Page or Home Page.

  1. Navigate to the Lightning App Builder.

    Click to open the Setup menu and select Setup, then open User Interface > Lightning App Builder.

  2. Edit an existing page or create a new page.

  3. Modify the page layout.

    Drag the Revenue Metrics Chart component (under Custom - Managed) to an appropriate region of the page.

  4. Optionally, specify a business entity whose data is to be displayed by default.

    Users can switch to another business entity directly in the chart at any time.

  5. Click Save.

  6. Click Activate.

    This makes the page available to users, enabling them to easily assess forecasted and invoice revenue. For details on reading the chart, see Using Revenue Metrics.

For help about modifying Lightning pages, see Managing Pages or Create and Configure Lightning Experience Record Pages in the Salesforce Help.

Adding RRD List to Invoice

For troubleshooting purposes, you can let users inspect which RRDs a given invoice has produced. To this end, you add the Revenue Reporting Details related list to the Invoice Lightning record page:

  1. Click to enter Setup, then navigate to the object management settings of the Invoice (ONB2__Invoice__c) object.
  2. Click Page Layouts.
  3. In the Invoice Layout row, click , then select Edit.
  4. From the Related Lists palette, drag the Revenue Reporting Details list to the Related Lists section.
  5. Click Save.
  6. From the object management settings of the Invoice (ONB2__Invoice__c) object object, click Lightning Record Pages.
  7. Open the Invoice Record Page, and click Edit (or Clone if you edit the record page for the first time).
  8. Drag the Related List - Single component to an appropriate section of the page.
  9. In the Related List field of the component properties, select Revenue Reporting Details.
  10. Click Save.
  11. Click Activate.

    This makes the customized record page available to users, enabling them to see which RRDs a given invoice has produced.

(6) Controlling Update Behavior

When the forecast run executes, it queries the child records where the FC_Processed__c field is set false, builds the forecasted RRDs from their FC fields, creates or updates the matching RRPs, and then sets FC_Processed__c to true on the processed records.

Because of this flag, a re-run does not automatically reprocess records that were already handled. To force a recalculation after changing values on a source record:

  1. Set FC_Processed__c to false on the relevant child record(s).
  2. Execute the forecast run again.

    The next run deletes all forecasted RRDs associated with those records and recreates them from the current FC field values. The RRP itself is kept (its amount fields are recalculated) and may temporarily remain without any associated RRDs.

Note

JustOn does not reset FC_Processed__c back to false by default. Do this through your own automation – for example a Salesforce flow – whenever a source record should be reconsidered, including when a new child item is added.

Realized Revenue: Invoice Finalization, Cancellation, and Fix Invoices

The realized side (Type == Invoiced) is produced automatically by your normal invoicing processes – no extra configuration is needed beyond enabling the global setting.

Invoice Finalization
When an invoice is finalized, JustOn Billing & Invoice Management reads its invoice line items, applies the configured revenue recognition rules to split amounts across months (when a service period spans several months), creates Type == Invoiced RRDs, and creates or updates the matching RRP. Forecasted RRDs in the same period are left untouched.
Cancellation
When an invoice is canceled, its Type == Invoiced RRDs are deleted and the affected RRP amount fields are recalculated. The RRP remains, and forecasted RRDs are not affected.
Fix Invoices

To create revenue metrics for already finalized invoices – for example if you enabled the feature after finalizing, or changed a field such as Product Category – you use the Fix Invoices procedure and select the Create Revenue Metrics checkbox in the dialog. It applies the same logic as invoice finalization runs: if RRDs already exist for the selected invoices, they are deleted and recreated, and the RRP amount fields are recalculated.

The Create Revenue Metrics checkbox is disabled while the global setting Enable Revenue Metrics is off.

Product Category Aggregation

To cluster revenue by service group (for example licences, one-time items, support, maintenance), populate the product category:

  • For invoiced details: via the ON field mechanism on the invoice line item or item (it can also be a formula or set by a flow).
  • For forecasted details: via FC_ProductCategory__c on the source record.

RRDs of the same invoice that share the same Product Category and Class are aggregated into one RRD. The combined Invoice Line Items field then lists the contributing line item names. If the same product category produces both revenue and deduction amounts, JustOn Billing & Invoice Management creates a separate RRD per class.

Building Reports on Revenue Metrics

Beyond the built-in chart, you can use Business Reports or standard Salesforce reports on the Revenue Reporting Period and Revenue Reporting Detail objects to analyze forecasted and invoiced amounts by business entity, month, year, and product category.