Table of Contents
1. Create Closed Lost Reason field on Opportunity
2. Update the Flow Template to Populate Closed Lost Reason on Referral from your custom Closed Lost Reason on Opportunity
2.1. Update the other Flow Template
3. Create a validation rule on your custom Closed Lost Reason field on Opportunity
1. Create Closed Lost Reason field on Opportunity
Standard Salesforce Opportunity doesn’t have a field to track the closed lost reason. Hence many companies create a custom field for that purpose. If you already have such a field, then you can substitute all mentions of the Closed Lost Reason field in the custom field. However, in that case, you will have to train your users to only populate the field with the values that AWS accepts. The full list of such values can be found in the Closed Lost Reason picklist field on Referral.
If you don’t already have such a field or don’t want to change the business process around your existing field, create a new picklist field on Opportunity called, for example, Closed Lost Reason.
If propagating a closed lost reason from Opportunity to Referral doesn’t work for you for some reason, then you can extend the flow in a different way, but we don’t recommend that because it will create data discrepancy.
Populate its picklist values by copying them from the Closed Lost Reason picklist field on Referral. Use the Print View button for copy-pasting them quickly.
2. Update the Flow Template to Populate Closed Lost Reason on Referral from your custom Closed Lost Reason on Opportunity
When you have the field on the Opportunity from which to pull the value into the Referral, extend the packaged Flow Templates to do so.
- Go to Setup > Flows and click on “Update Referral from Opportunity”.
- In the Flow canvas, double-click on the Start element
- Scroll down to “Set Entry Conditions” and click + Add Condition.
- In the Field field, scroll down or search for your custom “Closed_Lost_Reason__c” and click on it.
- Set Operator to “Is Changed’ and Value to “{!$GlobalConstant.True}”
- Click Done.
- Double-click on the “Assignment set Referral fields”.
- Click + Add Assignment.
- In the Variable field click on the “Current Item from Loop”
- Then scroll down or search for “workspan__Closed_Lost_Reason__c” and click on it.
- In the Value field scroll down and click on “$Record Opportunity”.
- Then scroll down or search for your custom “Closed_Lost_Reason__c” and click on it.
- Click Done.
- In the top right corner of the canvas click Save As and then Activate.
2.1. Update the other Flow Template
Next, update the other Flow Template in a similar way.
- Go to Setup > Flows and click on “Update Referral when linking Opportunity”.
- Double-click on the “Assignment set Referral fields”.
- Click + Add Assignment.
- In the Variable field click on the “$Record workspan__Referral__c”.
- Then scroll down or search for “workspan__Closed_Lost_Reason__c” and click on it.
- In the Value field scroll down and click on “$Record workspan__Referral__c”.
- Then scroll down or search for “workspan__Opportunity__r” and click on it.
- Then scroll down or search for your custom “Closed_Lost_Reason__c” and click on it.
- Click Done.
- In the top right corner of the canvas click Save As and then Activate.
3. Create a validation rule on your custom Closed Lost Reason field on Opportunity
In order to fool-proof the process, it will be best to create a validation rule on the Opportunity to make sure your users will populate your custom Closed Lost Reason field when marking an Opportunity has ‘Closed Lost’. Otherwise, if the field is left blank, the workspan__Closed_Lost_Reason__c field will also remain blank, and the packaged validation rule will throw an error.
- Go to Object Manager > Opportunity > Validation Rules and click New in the top right corner.
- Create a rule that your custom Closed Lost Reason field can’t be blank when the Opportunity Stage is ‘Closed Lost’.
ISPICKVAL(Closed_Lost_Reason__c, '')
&& ISPICKVAL(StageName, 'Closed Lost')
- Feel free to add more conditions and use a different error message that makes sense according to your business processes.
- Don’t forget to check the Active box and click Save.
Comments
Article is closed for comments.