In this article working with related records , I had discussed a way to use the Process Builder to update the Status of related Quotes to Denied for an Opportunity, whenever a Quote is accepted by the customer. Once a Quote is accepted by the customer the next step is to Sync Accepted Quote with Opportunity. In this article I am going to discuss how to automate Quote Sync Process. Let’s start with a business use case
Business Use case:- Steve Cartwright is working as System administrator in Universal Container. He receives a requirement to Automatically Sync accepted Quote with Opportunity, because business users always forget to Sync accepted Quote with Opportunity and it create problems in reporting.
Solution of above business requirement
There are multiple solutions possible for the above business scenario. You can either use Apex trigger, combination of Flow and Inline Visualforce Page, and few more. We will use Flow and Process Builder 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 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 value in this field.
This article will help you to understand how to automate Quote sync process and way to Launch a Flow from Process builder. Follow the below instructions to create a Flow and Process for the above business requirement
1. Click on Name | Setup | App Setup | Create | Workflows & Approvals | Flows
2. Click on New Flow, it will open flow canvas for you, now create one Text variable VarT_QuoteId to pass the Quote ID. We will use this variable in the flow, as shown in the following screenshot
Likewise, create one more Text variable VarT_OpportunityId to pass the Opportunity Id.
3. The next step is to update the Synced Quote field with Quote Id. For this we will use Record Update element. Drag-and-drop Record Update Element on the window and fill the details as shown in the following screenshot
4. Finally your Flow will look like the following screenshot
5. Click on the Save button and save the Flow with the name Update Sync Quote as shown in the following screenshot
6. Don’t forget to Activate the Flow.
Launch a Flow from the Process Builder
Our next task is to create a Process on Quote object to Launch a Flow, only when a Quote is accepted by the customer. To create a Process on the Quote object follow the below instructions
1. Click on Name | Setup | App Setup | Create | Workflows & Approvals | Process Builder and click on the New button, Enter Name, API Name and click on the Save button
2. Once you are done click on the Save button, it will redirect you to Process canvas. Click on Object node to add object, Select Quote object, in this case and set the evaluation criteria, Please refer to the following screenshot for more details
3. Once you are done click on the Save button, it will redirect you to Process canvas. The next step is to define Process criteria. For this click on Add Criteria node, enter Criteria Name, Set filter conditions (Similar to Rule Criteria in WFR), as shown in the following screenshot
If you want to understand why I have selected Do you want to execute the actions only when specified changes are made to the record? check-box then please refer this article Auto Create and Activate the Contract
4. Once you are done click on the Save button, it will redirect you to Process canvas. Now we have to add an Immediate action into the Process to Launch a Flow. For this use Flows action. Use Field Picker to select the field Description and Text Entry field to enter a comment or sentence. Please refer the following screenshot for more information
5. Once you are done click on the Save button, it will redirect you to Process canvas. Finally the Process will look like the following screenshot
It’s time to test this Process
Now onwards if a business user updates the Quote Status to Accepted, Process builder will automatically Sync Accepted Quote with Opportunity.
1. Currently Quote “Burlington Textiles Weaving Plant Generator” in Presented Status, as shown in the following screenshot
2. Now we will try to update the Quote “Burlington Textiles Weaving Plant Generator“ 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 of Process Builder Auto Sync Accepted Quote with Opportunity, as shown in the following screenshot
Note :-I will suggest you to Implement this first on your developer org test it and then move it to Production.