Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

From Version 2.120 and up, it is now possible to trigger the automatic update of pre-existing invoices. Activation of these 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. Click the button New

  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 “OptimizerVersionActivationCompleteEvent

  9. Select the object “Optimizing Version

  10. Setup the following matching conditions

  11. Press Save

  12. You 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

  13. Now select an Action. In order to trigger the pre-invoice generation select Apex  ADvendio__GenerateInvoiceController. Set the Apex variables as follows

  14. 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.

  1. Navigate to Setup

  2. Expand the section Process Automation

  3. Click the link Flows

  4. Click the button New Flow

  5. Select the ADvendio Optimizer OptimizerVersionActivationCompleteFlow template

    1. The Flow template comes with a pre-created Apex Action that will generate the PreInvoices for a given Media Campaign.

  6. Create a new Flow adding any custom logic you wish to trigger based on the Platform Event “OptimizerVersionActivationCompleteEvent

    In order to invoke the Flow from the process, go back to the process and delete the Apex Action you created earlier

  7. Create a new Flows Action which will invoke the Flow you just created

    1. If your Process was already activated, you may need to clone it before you can make these changes

  8. You will also need to pass the Media Campaign ID to the Flow, as you can see below

  9. Activate your new process

Your process will now automatically generate pre-invoices when an optimizing version with pre-invoices is activated.

  • No labels