Flow templates to keep Referral and Opportunity in sync

Follow

These are Flow Templates with the purpose of updating Referral(s) when the parent Opportunity changes or updating the Opportunity when its child Referral changes—all to keep data between records in sync.

Beware that field updates that span multiple records are all run in a single context and are also all rolled back in the same context if an error occurs anywhere along the way. For example, let’s say you are utilizing the AWS use cases (See here), and you have activated the Update Referral from Opportunity Flow Template. Then on an Opportunity with a Referral for the Amazon partner, you set Stage to ‘Closed Lost’ and click Save. This will result in a validation error being thrown (because there is a validation rule on Referral that prevents Sales Stage from being ‘Closed Lost’ if Closed Lost Reason is blank), and not only will the Referral not be updated, but also the Opportunity will not save until you either populate the Closed Lost Reason field on Referral, disable the validation rule (which will result in bad data being sent to AWS), disable the Flow Template, or extend the Flow Template (See here) to bypass or accommodate the validation rule.

1. Update Referral from Opportunity Flow Template (Mandatory)

OOTB this flow updates the Close Date and Sales Stage fields on all Referrals (which are NOT “Declined”) whenever Close Date or Stage changes on their parent Opportunity. Extend it (and also maybe the Update Referral from Opportunity Flow Template if you want more Opportunity field updates to be synced down to the Referral level.

If you are going to activate this Flow Template or a version of it, and if you are utilizing the AWS use cases, then you absolutely have to extend it to accommodate the ClosedLostReasonRequired validation rule on Referral. Here is an example of how it can be achieved (Refer to this).

2. Update Referral when linking Opportunity Flow Template (Mandatory)

OOTB this flow updates the Close Date and Sales Stage fields on one Referral to match Close Date and Stage values from its parent Opportunity whenever this Referral is linked (or re-linked, which you shouldn’t really be doing) to this Opportunity.

This creates an unintentional side effect if you have both this Flow Template as active and a default value mapped for a field.

1. Let’s say an AE has an Incoming Referral with a Closed Date = 12/12/2030, and they want to link it to an Opportunity with a Closed Date = 1/1/2022. So they select the Opportunity and click the Link button.

2. If the default Field Mapping is intact, then in the opened Edit Referral modal, AE will see the Closed Date change to 1/1/2022 (because it’s pulled from the Opportunity). If the default Field Mapping is removed, then AE will see Closed Date = 12/12/2030 and skip right to step 4.

3. Let’s say AE changes the Closed Date back to 12/12/2030.

4. AE clicks Save.

5. After the page refreshes, AE will see that the Closed Date is 1/1/2022.

It happens because the Flow update runs last, pushing the value from Opportunity to Referral again after the manual change. This means that you can’t have a discrepancy in the synced fields between Opportunity and Referral. This is the business goal of having this Flow in the first place, so that’s good. Unfortunately, the AE is not informed that there is no point in editing the fields that are kept in sync by the Flow because, in the end, the Opportunity’s value will always prevail.

But Field Mapping is not applied when you create a new Opportunity. It’s also not possible to fit this use case under the Update Referral from Opportunity Flow Template because it has a different entry trigger—that’s why a separate Flow Template is required.

Extend this Flow Template (and also maybe the Update Referral from Opportunity Flow Template if you want more Opportunity field updates to be synced down to the Referral level when creating Opportunity from Referral.

If you are going to activate this Flow Template or a version of it, and if you are utilizing the AWS use cases, then you absolutely have to extend it to accommodate the ClosedLostReasonRequired validation rule (Refer 2.15.1) on Referral. Here is an example of how it can be achieved.

3. Update Opportunity from Referral Flow Template (Optional)

OOTB this flow updates the Next Step field on the Opportunity whenever it changes on its child Referral. Extend it if you want more Referral field updates to be synced up to the Opportunity level.

Beware that there is no way to define race conditions in Flows, so if multiple Referrals are changed to have a different value in the same field under the same Opportunity at the same time, there is no way to define which value will end up in the Opportunity field. If you also have the Update Referral from Opportunity Flow Template active, this final Opportunity value will be propagated down to all Referrals right away.

4. Alternative option of handling the closed lost AWS Referrals

If you are going to use this option or a version of it, then you will create data discrepancy: the Opportunities will be marked as Closed Lost, but the Referrals related to this Opportunities will remain open (in Salesforce, in WorkSpan, and in AWS) until somebody closes them manually and specifies a Closed Lost Reason. That’s why we strongly suggest you should find a way to propagate closed lost reasons from Opportunity to Referral.
Edit the Start node and update the Set Entry Conditions section to look something like this:

Beware that this will result in NO fields being copied when Opp is in the ‘Closed Won’ or ‘Closed Lost’ Stage.

Know more about the Flow Template extension example and Flow templates to auto-create Referral from Opportunity

0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.