0

Hello Salesforce StackExchange Community,

Background:

Our company just implemented a new Flow that was created from a 3rd party company which we no longer have access to. Our company makes an app and customers are allowed to try it free. After their trial period is over and they need to start paying, they hit what we call the paywall. Once this event happens, a record on custom object called Paywall Hit is created. From there, our new Flow is triggered to run through certain Account and Lead criteria and create an Opportunity or not.

Issue:

We are finding that duplicate Opportunities are being created. In some cases, a new event from our company's app creates a Paywall Hit record and triggers the Flow. However, some events are being processed while the previous event is being processed and the previous event doesn’t complete all the way through to prevent the next event from doing the same thing. My understanding is that this is called a 'race condition'.

Question:

Is there a solution within Flow Builder grab the Opportunity record created before the existing one that is getting processed? Something like, if this Opportunity record is = previous Opportunity record, then ignore and don't create?

Below is a pic of the Decision element in the Flow where we believe this is happening. I hope this makes sense. Not sure if this is possible or not so I figured this would be the place to ask. Thank you all so much for you time and consideration with this question.

enter image description here

2
  • Easier: create a scheduled flow that runs on some recurring basis and deletes dupes
    – identigral
    Jun 28, 2022 at 18:48
  • The direct answer to your question is NO; Flow interviews are unaware of each other. Can you use the Account record as a kind of semaphore/mutex to avoid two interviews trying to create an oppo at the same time
    – cropredy
    Jun 28, 2022 at 22:04

1 Answer 1

0

What you can do here is set a 1-2 comparison parameters such as email or mobile number and compare it with the existing DB. If the number is matching , you can throw a error cannot create a new opportunity, else let it create a new opportunity. You can do this with a trigger.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .