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

  1. Navigate to Setup

  2. Expand the section Process Automation

  3. Click the link Process Builder

  4. Either clone and use the template Process Complete Event (Optimizing Version) or Click the button New and create a Process as follows

  5. Enter the Name for your new Process

  6. Select that the process starts when A Platform Event Message is received

     

  7. In your newly created process, click Add Trigger

  8. Search for the Platform Event “ProcessCompleteEvent

  9. Select the object “Optimizing Version

  10. Setup the following matching conditions

     

  11. Press Save

  12. click Add Criteria

  13. Give your Criteria a name, (for example OptimizerVersionActivation), and select Criteria for Executing Actions: Conditions are met

  14. Setup the following conditions
    Value: OptimizerVersionActivation

     

  15. Press Save

  16. 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.Id

     

  17. Your process should look as follows (including any other additional criteria you may have added)