Skip to content

How to allow custom processes to modify invoices?

Usually, JustOn does not allow processes to modify invoice records or invoice line item records. A validation mechanism prevents unauthorized code (such as your custom process) from doing so.

Certain business use cases, however, may require to have custom processes change some data in draft invoices. To this end, you can "whitelist" your process.

Note

Use the process whitelisting feature with caution. Whitelisted processes bypass the code validation and, consequently, JustOn's invoice calculation logic.

Test your process thoroughly, and make sure that the modifications do not produce incorrect invoices.

Be aware that the JustOn support team may be unable to provide help with issues that result from whitelisted custom processes.

To allow your process to modify invoice records or invoice line item records, you set the Apex class Set Business Process as the first action to be executed, setting the following Apex variables (depending on whether your process intends to modify invoice data or invoice line item data):

Field Type Value Notes
Business Process Status String INVOICE_BUILDER Used to whitelist process that modifies invoice data
INVOICELINEITEM_BUILDER Used to whitelist process that modifies invoice line item data
Record Id (Type Reference) Field Reference [ONB2__Invoice__c].Id Refers to the invoice record if the process modifies invoice data
[ONB2__InvoiceLineItem__c].Id Refers to the invoice line item record if the process modifies invoice line item data

whitelist_process
Action to whitelist a process intended to modify invoice data

Once the whitelisting action is set, you can proceed to add the action(s) to actually modify the data as intended.

Related information:

Create a Process in the Salesforce Help