What Does This Post Cover?
- How to automate opportunity splits using process builder and flow in Salesforce
Use Case?
- Update your opportunity splits when a field is changed or updated
In this example our use case will be:
A project required that we update the opportunity splits and opportunity team members when a field on the opportunity object was updated. By doing this we would be saving loads of time in the long run on our revenue operations team and sales team since it would be removing all of the manual work of doing both of these repetitive tasks. After I completed this, I found it wasn't too challenging but, when scoping this project I didn't see a lot of resources out there on this topic.
#1 Plan, Plan, Plan
Like all projects, you should plan out how this automated process is going to work and I suggest, drawing it out on paper so you have a clear understanding before you hop in there and start making changes. Consider the following when planning:
What will trigger your process to fire?
What automation will be required?
What is the least complicated way you can execute this?
#2 Flow (Autolaunched Flow)
Once you see this part you are going to realize how easy this project actually is. It's literally 2 elements you are putting in your flow. In this post, I will not be going over the basics of flow so if you aren't aware of how to create a flow at this point in time please check out trailhead.
Create Opportunity Team Member - OpportunityAccessLevel = "Edit" - OpportunityId = {!RecordId} - TeamMemberRole = "[whatever you want to put here for the title]" - UserId = "[whatever user you want to refer to here]"
Create Opportunity Split - OpportunityId = {!RecordId} - SplitOwnerId = {!NewOppSplitGuy} - SplitPercentage = "[whatever percentage you want to put here]" - SplitTypeId = "[whatever ID you want to use for this creation]"
Variables - RecordId = This is the active record ID that will be passed from the PB to the Flow - NewSplitOppGuy = This is the field that is updated that will trigger my PB and Flow to run
#3 Process Builder
Since we are going to launching this puppy as an autolaunch flow we need to build out the criteria on the Opportunity Process Builder so that in our case, when an opportunity field changes - it will call the flow and run this process.
Opportunity Process Builder - Object = Opportunity - When a record is created or edited
Node: "_____ Field changed?" - _____ field ISCHANGED = True - _____ field ISNULL = False
Immediate Action: Add Opportunity Split! - Call the flow you just created - Pass in the Record ID (opportunity ID in this case) - Pass in the field that is being changed in your node we listed above this ☝🏼
#4 Testing
Alright if you got this thing set up right you should see something like the GIF below
Comments