Getting Started with Process Builder – Part 9 (Auto Revenue Splitting in Opportunities)

Getting Started with Process Builder – Part 9 (Auto Revenue Splitting in Opportunities)

Last Updated on December 15, 2020 by Rakesh Gupta

Big Idea or Enduring Question:

How do you automatically split revenue using Process Builder?

In a recent email conversation with a Community member, we discussed the possibility of auto Split Opportunity revenue with Opportunity Team Members. When a new member is added to the Opportunity Team by clicking on the Add Opportunity Team Members (1) button and not for Add Default Team (2), as shown in the following screenshot: 

Objectives:

After reading this blog, you’ll be able to: 

  • Understand the basic components of Process Builder 
  • Learn how to split the opportunity revenue using Process Builder

Business Use case

Martin Jones is working as a System Administrator at Universal Containers (UC). He has received a requirement from higher management to auto-share 1% of Opportunity revenue with, Opportunity team members as soon as a new member is added to the Opportunity team. Same time they don’t want to implement this feature when a user uses the Add Default Team button to add a default Opportunity team to an Opportunity.

Automation Champion Approach (I-do):

Multiple approaches can be taken to solve this business requirement. Either a process builder or Flow and Inline Visualforce Page or other approaches can be taken. In this case, Process Builder is being used to solve this requirement.

Before proceeding, ahead, understanding the below-listed salesforce objects: 

Field Name Details
OpportunityTeamMember Represents a User on the opportunity team of an Opportunity.
OpportunitySplit Credits one or more opportunity team members with a portion of the opportunity amount.
OpportunitySplitType Provides unique labels and behavior for each split type.

Before discussing it, let me show you a diagram of a Process Flow at a high level. Please spend a few minutes to go through the following Flow diagram and understand it.

Team Selling should be enabled in the org. If it isn’t yet enabled,  and want to do so, then please have a look at the Splitting Credit across Your Sales Team article.

Let’s begin building this automation process.

Guided Practice (We-do):

There are 6 steps to solve Martin’s business requirement using Process Builder. We must: 

  1. Find Opportunity Split Type Revenue Id
  2. Creating a custom label to store Opportunity Split Type Revenue Id
  3. Define process properties
  4. Define evaluation criteria
  5. Define process criteria
  6. Add action – create a record 

Step 1: Find Opportunity Split Type Revenue Id

The first step is to find out the Id of Opportunity split type Revenue. One possible workaround is to use the Developer Console. 

  1. Click Setup | Developer Console 
  2. In the Query Editor, run the following SOQL query 
    1. Select id,MasterLabel from opportunitySplitType
  3. Make sure to Copy Revenue Id. 

Step 2: Creating a Custom Label 

  1. Click Setup.
  2. In the User Interface, type Custom Labels.
  3. Click on the New Custom Label button.
  4. Enter Short Description the Name will auto-populate. 
  5. Now enter the Opportunity Split Type Revenue Id in the Value.
  6. Click Save.

Step 3: Define Process Properties

  1. Click Setup.
  2. In the Quick Find box, type Process Builder.
  3. Select Process Builder, then click New.
  4. Name the Process and click the Tab button. The API Name will populate. 
  5. As a best practice, always input a description
  6. The process starts when A record changes.
  7. Click Save.

Step 4: Define Evaluation Criteria

  1. Click on the Add Object node to begin selecting the evaluation criteria.
  2. Select the Opportunity Team Member object from the dropdown list.
  3. Start the process only when a record is created.
  4. Click Save.

Step 5: Define Process Criteria

  1. Click the Add Criteria node to begin defining the process criteria.
  2. Name the criteria.
  3. For Criteria for Executing Action
    1. Select No Criteria – Just execute the actions! 
  4. Click Save.

Step 6: Add Action – Create a Record

  1. Below Immediate Actions, click Add Action.
  2. For Action Type, select Create a Record
  3. Name the action.
  4. Select the Opportunity Split record type. 
  5. Set Field Values:
    1. Row 1:
      1. Field: Opportunity ID
      2. Type: Field Reference
      3. Value: Opportunity Team Member | Opportunity ID
    2. Click Add Row
    3. Row 2:
      1. Field: User ID
      2. Type: Field Reference
      3. Value: Opportunity Team Member | User ID
    4. Click Add Row
    5. Row 3:
      1. Field: Percent
      2. Type: Number
      3. Value: 1 
    6. Click Add Row
    7. Row 4:
      1. Field: Opportunity Split Type ID
      2. Type: Formula
      3. Value: System Variable | Label | Opportunity Split Type Revenue Id
  6. Click Save.

Almost there! Once everything looks good, click the Activate button. 

Note:- Before you activate your process, you will want to make sure that you have assigned data in the correct format because Process Builder obeys validation rules. If some fields are required by using validation rules, then make sure you have added those fields. Conversely, if some fields are required on the page layout, you can ignore those fields. 

Proof of Concept

Now onwards, if business users add new members in Opportunity Team by clicking on the Add button (Available under Opportunity Team related list on the Opportunity Detail page), then Process Builder will automatically Share 1% of Opportunity revenue with them.

  1. Right now, there is only Opportunity Owner and no team members in Opportunity Team for Opportunity Burlington Textiles Weaving Plant Generator, as shown in the following screenshot:
    1. Below is the current status of Opportunity Splits.
  2. Now we will try to add a new team member in Opportunity – Burlington Textiles Weaving Plant Generator by clicking on Add Opportunity Team members button, as shown in the following screenshot:
    1. It will redirect you to the page from where you can add new members to an Opportunity, as shown in the following screenshot:
  3. Once you are done, click on the Save button and navigate to the Opportunity Splits related list available on the Opportunity Detail page. 1% of Opportunity revenue is automatically shared with new Team members by Process Builder, as shown in the following screenshot:

Note: -Process Builder won’t work if you add members to the Opportunity Team by clicking on “Add Default Team“. 

Formative Assessment:

I want to hear from you!  

What is one thing you learned from this post? How do you envision applying this new knowledge in the real world? 

Let me know by Tweeting me at @automationchamp, or find me on LinkedIn.

Have feedback, suggestions for posts, or need more information about Salesforce online training offered by me? Say hello, and leave a message!

7 thoughts on “Getting Started with Process Builder – Part 9 (Auto Revenue Splitting in Opportunities)

  1. Hello. I agree, this is very helpful information. I am running into an error, however, where the system is preventing the Opportunity Split record from being created because the Revenue splits must equal 100%. I was wondering how this design would address this challenge and when I just tested it I am still receiving this error. Please let me know if I missed a step in the process but I don’t believe I did. Thank you for your time!

  2. This was really very helpful. However I added two criteria and the process doesn’t work. Maybe you can help me? The first criteria I added is that the opportunity needs to have a specific record type. That is working fine. But in the same criteria I added a second rule saying: Opportunity Owner Role contains “development”. I have a formula field on the opportunity that shows me the owner role. This is the field I’m referring to. The process doesn’t work and I am wondering if it is due to the field or due to “contains the word development”. Any experience with such a case? Thanks a lot!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.