8.10 ADvendio Features for Salesforce Sales Cloud Users (Opportunity Sync)

Challenge

If you have Sales Cloud users using Opportunities as well as ADvendio users you might want to sync your Media Campaign data with your Opportunity data to report on both of them.


Solution

After fulfilling the setup steps in this Wiki you can sync the following fields from the Media Campaign into your Opportunity records:

  • Amount

  • Description

  • Close Date

To achieve this the user would

  1. Create a new Media Campaign

  2. Create a new Opportunity and link it to your Media Campaign in the Opportunity lookup field as well as setting the checkbox for the sync

  3. Now a flow will run every time a relevant field was changed in the Media Campaign to update Opportunities data, such as the Close date, description or the Amount. 


Setup

Create new fields

  1. Go to the Media Campaign Object via Setup > Object Manager > Media Campaign

  2. Switch to the Fields and Relationships tab and Create a new field

  3. Select the data type “Checkbox“ and hit next

  4. Set the label to “Sync MC to Opportunity“ and the name as “SyncMediaCampaignToOpportunity__c“

  5. Leave the defaults set and finish the creation while making sure that the field is added to page layouts and necessary permission sets.

  6. Create another field on the Media Campaign object.

  7. Select the data type “LookupRelationship“ and go to the next page to select “Opportunity” to be the related object and hit next

  8. Set the label to “Opportunity“ and the name as “Opportunity“

  9. Leave the defaults set and finish the flow creation while making sure that the field is added to page layouts and necessary permission sets.

Make sure that every Opportunity is only linked to one Media Campaign to avoid the inconsistency of data. This can also be automated by trigger or flow logic if required. 

Custom Metadata Types 

Create Custom Metadata Type records in your org which help to sync Media Campaign fields to Opportunity fields. 

  1. Go to Setup > Custom Metadata Types > Manage Records for “Sync SObject To SObject“

  2. Hit New and create 3 records based on the table below: 

Label

Sync SObject To SObject Name

Source field (from Media Campaign)

Target field (from Opportunity)

Label

Sync SObject To SObject Name

Source field (from Media Campaign)

Target field (from Opportunity)

Amount

Amount

ADvendio__Amount_net_net_net__c

Amount

Close Date

CloseDate

ADvendio__Close_Date__c

CloseDate

Description

Description

ADvendio__Description__c

Description

Create a Salesforce Flow

  1. Go to Setup > Flows > New Flow

  2. Select the type “Record-Triggered Flow“ 

  3. Open the Start component and select the Media Campaign as start object. 

  4. Select as Triggering the point when… “A record is created or updated”

  5. Leave the rest set as default. 

  6. Create a decision component in the flow based on the screenshot below

  7. For the flow case where relevant fields were changed add an Action component to the flow based on the screenshot below. Add the Action called “ADvendio__SynchronizeSObjectToSObject“

  8. Save and Activate the flow and give the flow a name.