Last Updated on February 10, 2022 by Rakesh Gupta
Big Idea or Enduring Question:
How do you automatically sync Accepted quotes with their respective Opportunity?
In this article Auto Sync Accepted Quote with Opportunity, I had discussed a way to use Salesforce Flow and Process Builder to automatically sync Accepted quotes with their respective Opportunity, whenever a Quote is accepted by the customer. This article will show you how you can achieve such use cases using Salesforce Flow.
Objectives:
After reading this blog post, the reader will be able to:
- Use After-save Record-Triggered Flow to update records
- Use Flow to automatically sync Quotes with the status of Accepted with the Opportunity
Business Use Case
Steve Cartwright is working as a System administrator at Universal Containers (UC). He has received a requirement to Automatically Sync accepted Quote with Opportunity because business users always forget to Sync accepted Quote with Opportunity and it creates problems in reporting.
Automation Champion Approach (I-do):
There are multiple solutions possible for the above business scenario. You can either use an Apex trigger, a combination of Flow and Inline Visualforce Page, and a few more. We will use After-save Record-Triggered Flow to solve the above business requirement.
Before starting the Implementation, you have to understand one important concept related to the Sync Quote feature. There is a field on the Opportunity object i.e. Synced Quote. It’s nothing but a Lookup of the Quote Object. To automate Quote Sync Process, you have to populate the value in this field.
This article will help you understand how to automate the Quote sync process and create a Flow to automate the business processes.
Before discussing it, let me show you a diagram of a Process Flow at a high level. Please spend a few minutes to go through the following Flow diagram and understand it.
Guided Practice (We-do):
There are 1 steps to solve Steve’s business requirement using After-save Record-Triggered Flow. We must:
- Define flow properties for record-triggered flow
- Add an update records element – update opportunity sync quote
Step 1: Salesforce Flow – Define Flow Properties
As we have a requirement to update the parent (related) record file, this is why we are suing After save flow.
- Click Setup.
- In the Quick Find box, type Flows.
- Select Flows then click on the New Flows.
- Select the Record-Triggered Flow option and click on Next and configure the flow as follows:
- How do you want to start building: Freeform
- Trigger the Flow When: A record is created or Updated
- Run Flow: After the record is saved
- Object: Quote
- Select All Condition Are Met (AND).
- Set Conditions
- Row 1
- Field: Quote | Status
- Operator: Equals
- Value: Accepted
- Row 1
- Click Add Condition
- Row 2
- Field: Quote | OpportunityIs
- Operator: Is Null
- Value: {!$GlobalConstant.False}
- Row 2
- Choose the Option to Only when a record is updated to meet the condition requirements.
- Click Done.
Step 2: Salesforce Flow – Update Records (Update Opportunity – Sync Quote)
The next step is to update the Synced Quote field with Quote Id. For this, we will use the Update Records element.
- Under Toolbox, select Element.
- Drag-and-drop Update Records element onto the Flow designer.
- Enter a name in the Label field; the API Name will auto-populate.
- Click Specify conditions to identify records, and set fields individually
- Object: Opportunity
- Select All Conditions Are Met (AND).
- Set Filter Conditions
- Row 1:
- Field: Id
- Operator: Equals
- Value: {!$Record.OpportunityId}
- Row 1:
- Set Field Values for the Opportunity Records
- Row 1:
- Field: SyncedQuoteId
- Value: {!$Record.Id}
- Row 1:
- Click Done.
In the end, Steve’s Flow will look like the following screenshot:
Once everything looks good, perform the steps below:
- Click Save.
- Enter Flow Label the API Name will auto-populate.
- Click Show Advanced.
- Type: Record-Triggered Flow
- API Version for Running the Flow: 50
- Interview Label: Sync Quote Automation {!$Flow.CurrentDateTime}
- Click Save.
Almost there! Once everything looks good, click the Activate button.
Proof of Concept
Now onwards if a business user updates the Quote Status to Accepted, Salesforce Flow will automatically Sync Accepted Quote with Opportunity.
- Below is the current status of Quote Sample Manufacturing 2020 in Presented Status before the update.
- Update the Quote Status to Accepted, as shown in the following screenshot.
- Once you are done, click on the Save button and check the Syncing Check-box available on the Quote object. It’s already checked because the Salesforce Flow Auto Sync Accepted Quote with Opportunity, as shown in the following screenshot:
Formative Assessment:
I want to hear from you!
What is one thing you learned from this post? How do you envision applying this new knowledge in the real world?
Let me know by Tweeting me at @automationchamp, or find me on LinkedIn.
One thought on “Auto Sync Accepted Quote with Opportunity”