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
Create a new Media Campaign
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
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
Go to the Media Campaign Object via Setup > Object Manager > Media Campaign
Switch to the Fields and Relationships tab and Create a new field
Select the data type “Checkbox“ and hit next
Set the label to “Sync MC to Opportunity“ and the name as “SyncMediaCampaignToOpportunity__c“
Leave the defaults set and finish the creation while making sure that the field is added to page layouts and necessary permission sets.
Create another field on the Media Campaign object.
Select the data type “LookupRelationship“ and go to the next page to select “Opportunity” to be the related object and hit next
Set the label to “Opportunity“ and the name as “Opportunity“
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.
Go to Setup > Custom Metadata Types > Manage Records for “Sync SObject To SObject“
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) |
---|---|---|---|
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
Go to Setup > Flows > New Flow
Select the type “Record-Triggered Flow“
Open the Start component and select the Media Campaign as start object.
Select as Triggering the point when… “A record is created or updated”
Leave the rest set as default.
Create a decision component in the flow based on the screenshot below
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“
Save and Activate the flow and give the flow a name.