Can I display usage data on invoices produced on GIR?
← Billing & Invoice Management FAQ ← PDF and Email FAQ
Your business may require to display usage data on an invoice produced by a generic invoice run. Assume you do not need to actually calculate the usage data – you just want some additional records to be listed as "parts" that make up an invoice line item. That is, you do not rely on proper usage data billing.
Ideally, you hold the usage data using a dedicated object that is a child to the object used to produce the invoice line items. Including the relevant records in the transaction table requires the following configuration tasks:
- Adding an invoice lookup and the
ON_AddToTransactionTablecheckbox to the usage data object - Creating a flow that sets the invoice on the usage data records
- Configuring the
Transaction Recordsfield on the relevant template
Proceed as follows:
-
Create an invoice lookup on the usage data object.
API Name Data Type Description ON_Invoice Lookup (Invoice) Links the usage data record to the related invoice. -
Add the
ON_AddToTransactionTablecheckbox to the usage data object.API Name Data Type Description ON_AddToTransactionTable Checkbox Determines whether to show the usage data record on the invoice.
Must be selected.
After the selected usage data records have been processed, the software deselects them. If required, you can then select the records again. -
Create a flow to fill
ON_Invoiceon the usage data records.Configure the flow according to your needs, for example, like:
Flow Element Option Value Start Object <invoice_line_item_source>Trigger A record is created or updatedConditions All Conditions Are Met (AND)ON_Invoice__cIs changed{!$GlobalConstant.True}Action Action Update Related RecordsHow to Find Records Update records related to the <invoice_line_item_source> record that triggered the flowSelect Related Records {!$Record.<usage_data_object>__r}Set Field Values ON_Invoice__c←{!$Record.ON_Invoice__c}Once set up, this flow will copy any new or changed value from
ON_Invoiceon the invoice line item source record toON_Invoiceon the usage data record.For help about creating flows, see Flows in the Salesforce Help.
-
Configure the
Transaction Recordsfield on the relevant invoice template to display the usage data as required.Specify at least the following keys:
Key Data Type Description active Boolean If set true, activates the current configuration.title String Specifies the text to be printed above the transaction table. name String Specifies the API name of the usage data object. fields List of strings A comma-separated list of field API names that specify the transaction table columns and their order to be rendered. For details, see Displaying Transaction Records on Invoices.
Once set up as required, this triggers JustOn Billing & Invoice Management to create the usage data table and print it to the invoice PDF.