Skip to main content
Chuck De Vries (Rocket Mortgage) 님이 #Automation에 질문했습니다

I have a Process Builder automation on the opportunity product that creates a lead off of the opportunity if certain products are added to the opportunity.  It then marks the opportunity as "Has Spawned Lead" so that the opportunity will not spawn another lead. 

 

It works great, except that sometimes it will create 2 or 3 leads. If users are entering products using the add products from the related list, and two of the products they add to the opportunity are in the list of products that should generate a lead, then would it run that process twice before updating the opportunity to not spawn another lead?  Does the process builder run twice in a row with each product before it marks the opportunity as ineligible to spawn a lead? 

 

  #Automation 

답변 4개
  1. 2021년 9월 27일 오전 4:46

    Hi, @Chuck De Vries,

     

    This one is was difficult to resolve, but it seems to be working in my dev org. The solution was to have a Process that triggers off the creation of an Opportunity Product. It has the same number of rows as products eligible for Lead creation (two, in my example). The first row checks to see if 1) the created Opp Product is lead-eligible product #1, and 2) that the "Has Been Spawned" field on the parent Opportunity is false.  If yes to both, it fires an autolaunched flow.  The row Stops, and does not Evaluate Next Criteria.  The second row does the same, except it is checking for lead-eligible product #2.  Both rows feed relevant data to the autolaunched flow.

     

    Hi, , This one is was difficult to resolve, but it seems to be working in my dev org. The solution was to have a Process that triggers off the creation of an Opportunity Product.

    *Note: The 'recordId' variable is the parent Opportunity Id.

     

    The flow creates Lead-eligible product #1 immediately.  It determines that it is product #1 in the Decision element, using the variable value (var_Pricing, in my example) input by the Process.

     

    When the flow is launched the second time, via row 2 in the Process, the flow determines it is now product #2 being created and then uses a two-second pause (this Pause element being the entire reason for needing the Process-Autolaunched Flow combo in the first place).  It then does another Decision to see if "Has Spawned Lead" is true.  If true, it does nothing - i.e. no additional Lead is created.  But if false, a Lead is created.  This ensures that a Lead is created in the event that only Lead-eligible product #2 is added to the Opportunity.

     

    HasBeenSpawned1.png

     

    In case it's helpful, I'm including screen shots of the Pause element and formula used within it to achieve the two second pause.

     

    HasBeenSpawned3.png

     

    HasBeenSpawned4.png

     

    It's a bit cumbersome and doesn't account for things like unchecking "Has Spawned Lead" in the event the eligible products are deleted from the opportunity. Nonetheless, I hope this helps. Good luck!

0/9000