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.
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):
|Business Process Status||String||
||Used to whitelist process that modifies invoice data|
||Used to whitelist process that modifies invoice line item data|
|Record Id (Type Reference)||Field Reference||
||Refers to the invoice record if the process modifies invoice data|
||Refers to the invoice line item record if the process modifies invoice line item data|
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.
Create a Process in the Salesforce Help