SFDC: How To

How To Create Two New Records Using New Salesforce Flows & Process Builder?

Business Challenge.

Many companies are slowed down by simple yet repetitive processes that require too much time and effort, preventing them from focusing on what really matters. In this article I will demonstrate how two Opportunities can be created when the initial Opportunity is Closed Won.

Use Case.

The core sales team focuses on Closing Opportunities. When the Opportunity is Closed Won, sales team wants to create:

  • the same Opportunity for the next year with Close Date set exactly in one years from Event Date that is stored on the Opportunity Product object

  • separate opportunity for a different sales team focusing on up sell Opportunities. It is required to create Opportunity for them only at Closed Won stage as their services will be only relevant to buyers who has purchased the initial service.

This is how the flow looks in general.

Screen Shot 2019-04-08 at 17.05.16.png

Now lets go into each element individually.

Step 1
Get all Opportunity Product Records with the Date.

 
Screen Shot 2019-04-08 at 17.23.17.png
 

Step 2
Next I am adding an “Assignment” logic to create Type1 Opportunity record.

 
Screen Shot 2019-04-08 at 17.25.30.png
 

Step 3
Next I am adding a “Create Records“ data piece where I am specifying my AccountID, Opportunity Close Date (as it is required field), Opportunity Name, New Opportunity Record Type (as two new Opportunities I will be creating will be different Record Types (each team have their own layout and fields)), and finally Stage = Open.

 
Screen Shot 2019-04-08 at 17.28.40.png
 

In Step 4 I repeat the same “Assignment” as in Step 2, only I use Type2 Record Type.
And in Step 5 I repeat the same “Create Records“ data, only I reference Type2 Record Type and Type2 Opportunity Name.

Lastly, we need to create a Process Builder. Luckily our PB will extremely simple.
First we need to specify our object that will be Opportunity in my case.
Next I will need to select a trigger point, which in my case will be every time Opportunity Stage = Closed Won.
Finally, I need to launch the Flow we built above and specify match the Fields from our Flow to Fields in Process Builder. Additionally, specifying our Opportunity Record Type IDs.

 
Screen Shot 2019-04-08 at 17.37.16.png