...
Navigate to Setup
Expand the section Process Automation
Click the link Process Builder
Click the button New
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 “OptimizerVersionActivationCompleteEventProcessCompleteEvent”
Select the object “Optimizing Version“
Setup the following matching conditions
Press SaveYou can add further criteria for when the process should run, as a default however you can select No criteria—just execute the actions! and give condition a name
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__GenerateInvoiceController. Set the Apex variables as follows
Value: ADvendio__OptimizingVersion__c].ADvendio__MediaCampaign__r.Id
Your process should look as follows (including any other additional criteria you may have added)
Optional: Creating a Flow
If you want to take advantage of the high customizability of Salesforce Flows, you can also use our Flow template to begin your custom Flow creation.
...
Navigate to Setup
...
Expand the section Process Automation
...
Click the link Flows
...
Click the button New Flow
...
Select the ADvendio Optimizer OptimizerVersionActivationCompleteFlow template
The Flow template comes with a pre-created Apex Action that will generate the PreInvoices for a given Media Campaign.
...
Create a new Flows Action which will invoke the Flow you just created
If your Process was already activated, you may need to clone it before you can make these changes
...
You will also need to pass the Media Campaign ID to the Flow, as you can see below
...
...
Activate your new process
...