Getting Started with Salesforce Flow – Part 22 (Auto Sync Accepted Quote with Opportunity)

Getting Started with Salesforce Flow – Part 22 (Auto Sync Accepted Quote with Opportunity)

Last Updated on December 19, 2020 by Rakesh Gupta

To understand how to solve the same business use case using Process Builder and Salesforce Flow. Check out this article Getting Started with Process Builder – Part 8 (Auto Sync Accepted Quote with Opportunity).

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.

Let’s begin building this automation process.

Guided Practice (We-do):

There are 1 steps to solve Steve’s business requirement using After-save Record-Triggered Flow. We must: 

  1. Define flow properties for record-triggered flow
  2. 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. 

  1. Click Setup.
  2. In the Quick Find box, type Flows.
  3. Select Flows then click on the New Flows.
  4. Select the Record-Triggered Flow option and click on Next and configure the flow as follows: 
    1. How do you want to start building: Freeform
    2. Trigger the Flow When: A record is created or Updated
    3. Run Flow: After the record is saved
    4. Object: Quote
  5. Select All Condition Are Met (AND)
  6. Set Conditions
    1. Row 1
      1. Field: Quote | Status
      2. Operator: Equals 
      3. Value: Accepted
  7. Click Add Condition
    1. Row 2
      1. Field: Quote | OpportunityIs
      2. Operator: Is Null
      3. Value: {!$GlobalConstant.False}
  8. Choose the Option to Only when a record is updated to meet the condition requirements.
  9. 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. 

  1. Under Toolbox, select Element
  2. Drag-and-drop Update Records element onto the Flow designer. 
  3. Enter a name in the Label field; the API Name will auto-populate.
  4. Click Specify conditions to identify records, and set fields individually
  5. Object: Opportunity
  6. Select All Conditions Are Met (AND)
  7. Set Filter Conditions
    1. Row 1:
      1. Field: Id
      2. Operator: Equals
      3. Value: {!$Record.OpportunityId}
  8. Set Field Values for the Opportunity Records
    1. Row 1:
      1. Field: SyncedQuoteId
      2. Value: {!$Record.Id}
  9. Click Done.


In the end, Steve’s Flow will look like the following screenshot:


Once everything looks good, perform the steps below: 

  1. Click Save.
  2. Enter Flow Label the API Name will auto-populate.
  3. Click Show Advanced.
  4. Type: Record-Triggered Flow
  5. API Version for Running the Flow: 50
  6. Interview Label: Sync Quote Automation {!$Flow.CurrentDateTime}
  7. 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.

  1. Below is the current status of Quote Sample Manufacturing 2020 in Presented Status before the update.
  2. Update the Quote Status to Accepted, as shown in the following screenshot.
  3. 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 Process Builder Auto Sync Accepted Quote with Opportunity, as shown in the following screenshot:

Opportunity

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.

Have feedback, suggestions for posts, or need more information about Salesforce online training offered by me? Say hello, and leave a message!

One thought on “Getting Started with Salesforce Flow – Part 22 (Auto Sync Accepted Quote with Opportunity)

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.