8.12 How to add custom logic to the Submit and Check Availability processes?

Role

Administrator

Version

2.130


Challenge

I want to customize the submit to adserver or check availability in ADvendio for example:

  • To add custom validations before your users can submit a Campaign Item to the AdServer, like making sure that enough inventory is available

  • To build custom buttons and guided user flows, which will include the availability check or the submit to an AdServer of Campaigns Items


Solution

A customized solution for many use cases can be created with Salesforce Flows. We enabled our features Check Availability and Submit to AdServer also for Flows.

Please have a look at the setup section to find out how this can be used.


Setup

If you are not familiar with Salesforce flows yet please have a look at the following trailhead: https://trailhead.salesforce.com/content/learn/modules/flow-basics

To create a flow for specific adserver actions you will first need to enter the Setup of your Salesforce instance. Then you enter the search term “Flows” in the Quick Search menu.

When you click on Flows you will get to the landing page to create flows. Hitting the “New” button will forward you to the flow creation page where you select the flow type at first.

Please take note that at the moment only screen flows are supported and not schedule-triggered flows or record-triggered flows.
We are investigating in this topic to also support the other types. Please contact your Technical Account Manager or support@advendio.com for more information.

You now select the type Screen Flow and click Create.

This will bring you to the flow canvas screen. Depending on your requirements you will be able to check values of different fields before the process is being started.

Example Flow

Our example is only allowing the AdServer submit when the availability of a Campaign Item is given.

Our flow to cover this use case will consist of the following steps:

  1. Get the Campaign Item records for the Media Campaign where the flow is being started.

  2. Check if the availability is given to show an overview which items will be submitted.

  3. Execute the Submit to AdServer action for the available items.

  4. The last step includes a screen that shows if the job was successful or not.

To enter the record id where the flow is being started into the flow you will need to create a text input variable with the name “recordId”. When the flow is being started from Media Campaign or Campaign Item the record id will be entered into that variable automatically.

After the flow is created and activated we create the action button on the Media Campaign object and add it to the Media Campaign page layout.

Then the flow can be started and tested.

Please remember that any error which is AdServer related will not be shown in this job (as this is the action). To check AdServer related errors the mail which will be sent out can be used as a basis.
For components you can see the error from the AdServer directly in the system.

For a differentiation between actions and components please have a look at the section below.

Example flow:

Setup information

Your flow can consist of nearly any kind of logic.

We offer actions and components for the AdServer jobs.
An action works without a UI, just doing the job. The component shows the AdServer UI as you may know it from our standard buttons.
Please have a look at the following setup options for the AdServer actions we offer you:

  • Check Availability Action:

    • The Check Availability feature can be added as an action to the flow. The full name is “Check Availability” with the subtitle “apex-ADvendio__CheckAvailabilityService“.

    • The action expects a Campaign Item Record Collection variable as an input.

  • Check Availability Component:

    • The Check Availability feature can be added as a custom component to the flow.

    • This is only applicable for screen flows. You can add the component to one of the screens. The full name is “AdServerGatewayForecast”.

    • This component expects a text variable with the Campaign Item records Ids comma-separated as an input.

  • Submit to AdServer Action:

    • The Submit to AdServer feature can be added as an action to the flow. The full name is “Submit to AdServer” with the subtitle “apex-ADvendio__SubmitToAdServerService“.

    • The action expects a Campaign Item Record Collection variable as an input.

  • Submit To AdServer Component:

    • The Submit to AdServer feature can be added as a custom component to the flow.

    • This is only applicable for screen flows. You can add the component to one of the screens. The full name is “AdServerGatewayBooking”.

    • This component expects a text variable with the Campaign Item records Ids comma-separated as an input.