7.2.19 Setup Commercial Optimizer
From Version 2.120 and up, it is now possible to trigger the automatic update/creation of pre-invoices upon activation of Optimizing Versions. Activation Optimizing Version triggers a Platform Event which you can be listened for by a Salesforce Process. Below you can find a step-by-step example of how such a process can be set up following installation of Version 2.120 or later.
Setting of the Process
Navigate to Setup
Expand the section Process Automation
Click the link Process Builder
Either clone and use the template Process Complete Event (Optimizing Version) or Click the button New and create a Process as follows
Enter the Name for your new Process
Select that the process starts when A Platform Event Message is received
In your newly created process, click Add Trigger
Search for the Platform Event “ProcessCompleteEvent”
Select the object “Optimizing Version“
Setup the following matching conditions
Press Save
click Add Criteria
Give your Criteria a name, (for example OptimizerVersionActivation), and select Criteria for Executing Actions: Conditions are met
Setup the following conditions
Value: OptimizerVersionActivationPress Save
Now select an Action. In order to trigger the pre-invoice generation select Apex → ADvendio__GenerateInvoiceBatch Set the Apex variables as follows
Value: ADvendio__OptimizingVersion__c].ADvendio__MediaCampaign__r.IdYour process should look as follows (including any other additional criteria you may have added)