Effective sales management starts with assigning leads, accounts, and opportunities to your sales reps in a fair and efficient way. For many sales teams, round robin assignment in Salesforce is the go-to method to accomplish this. By utilizing the right method within Salesforce, you can ensure a balanced workload for your reps and a streamlined sales workflow.
But, before implementing any of these methods, it’s important to understand your objectives and the specific Salesforce objects you’re working with. For example, Lead Assignment Rules may not be the best option for assigning tasks or opportunities. That’s why choosing the right approach and implementing it correctly is key to ensuring your reps are being matched with the right leads/opportunities that they are best suited to close.
This blog post provides an overview of different ways you can leverage Salesforce’s rules, flows, and other methods to round robin your leads to the right reps automatically.
Let’s start with a quick overview of Round Robin Distribution.
What is Round Robin Distribution?
Round robin distribution is a method of evenly distributing specific items (in this case – sales leads, contacts, opportunities, tasks, or accounts) among a group of individuals (read sales reps) in a predetermined order, ensuring that everyone receives an equal opportunity to receive a fair share of their items.
The process continues cyclically, with each person receiving an equal number of assignments until all the items (leads) have been distributed. However, the lead distribution process is a continuous cycle as new leads, opportunities, and tasks keep flowing in from different directions.
Round robin assignment ensures that each sales rep receives an equal number of leads or opportunities and helps to distribute workload evenly across the team. The process is particularly effective when there are many leads (or a perpetual influx of leads) to be assigned. In such a scenario, ensuring every sales rep has an equal chance to work on new business is important.
The Significance of Modulo Operation for Salesforce Round Robin Distribution
Salesforce round robin distribution methods often use the modulo operation to determine the order in which sales reps receive new leads. By applying the modulo operation to the lead number and the number of sales reps, you can evaluate which rep should receive the Lead based on the order established in the round robin distribution.
The MOD operator in Salesforce is a mathematical function that computes the remainder of a division between two numbers. It works by dividing the larger and smaller numbers and returning the remainder.
For instance, MOD(12,5) returns a value of 2, indicating that 12 divided by 5 leaves a remainder of 2. Similarly, MOD(15,3) would return 0, as 15 is evenly divisible by 3.
So, how does this determine the order of round robin? Let’s understand it with an example.
Suppose you have 16 new leads and 5 reps who will be assigned to these leads. Here’s how the MOD operation distributes the leads evenly among the reps:
- Assign each rep a number between 1 and 5. For example, you have reps numbered 1, 2, 3, 4, and 5.
- Divide the total number of new leads (16) by the number of reps (5). In this case, you’ll get a quotient of 3 with a remainder of 1. This means that each rep should receive 3 new leads, with 1 lead left over.
- You’ll use the MOD operation to assign the leads with the rep number and the total number of reps. For example, to determine which leads Rep 1 will receive, you’ll use the MOD operation with 1 as the rep number and 5 as the total number of reps:
These results tell you which leads each rep will receive. For example, Rep 1 will receive the leads numbered 1, 6, 11, and 16 (because 1, 6, and 11 have a remainder of 1 when divided by 5, and 16 has a remainder of 0).
Or
- Assign each rep a number between 1 and 5. For example, you have reps numbered 1, 2, 3, 4, and 5.
- First, MOD (16,5), total leads = 16, total reps = 5, gives quotient = 3 & remainder = 1. It means that each rep gets 3 leads, leaving 1 lead behind (which goes to the next rep in the queue)
- Add +1 to the rep number to assign it to the next rep in the queue.
Round Robin Lead Assignment Rules in Salesforce
Now let’s help you set up Lead Assignment Rules in Salesforce.
- First, create an auto-number field in the Lead object to keep track of every new Lead that comes in.
2.Next, create a formula field that calculates a round robin ID for each Lead based on the number of sales reps you have. It involves using the MOD function to find the remainder when dividing the lead number by the number of reps, and then adding 1 to the remainder to ensure that the IDs start from 1 instead of 0
3. Finally, you can hard-code your Lead Assignment Rules (LARs)(for each Round Robin ID) by matching each round robin ID to a designated sales rep. It ensures that each rep receives an equal share of leads without any overlap.
Example:
trigger contacttrigger on Contact (before insert) {
if(Trigger.isBefore){
Double roundRobinValue = 1;
List<Contact> conList = [SELECT Id, Round_Robin_ID__c, CreatedDate FROM Contact where Round_Robin_ID__c != null
order by CreatedDate desc limit 1];
if(conList != null && conList.size()>0){
roundRobinValue = conList[0].Round_Robin_ID__c;
}
for(Contact c : Trigger.New){
system.debug(‘###Round Robin Value : ‘+roundRobinValue);
if(roundRobinValue == 3){
roundRobinValue = 1;
c.OwnerId = ‘0057F000002FrWT’;
}
else if(roundRobinValue == 2){
roundRobinValue++;
c.OwnerId = ‘0057F000005vkd1’;
}
else{
roundRobinValue++;
c.OwnerId = ‘0057F000002Fyug’;
}
c.Round_Robin_ID__c = roundRobinValue;
}
}
}
The Round Robin Assignment Workflow looks like this after the configuration.
Challenges with Lead Assignment Rules
- Lead Assignment Rules only work for leads. If your sales process involves other objects, such as opportunities or accounts, you will need other methods to assign ownership of these objects.
- It does not provide a robust audit trail of ownership changes. While it is possible to track field history for the owner field, this can be a cumbersome and time-consuming process, particularly for organizations with large sales teams and complex lead assignment processes.
- Lead Assignment Rules can be difficult to manage and maintain over time. Whenever reps are added, leave the company, or take time off, you must update the Round Robin Id formula and adjust the rule entries to ensure that leads are assigned correctly.
Round Robin Lead Assignment with APEX Code
Apex programming language enables developers to create custom logic on the Salesforce platform to automate business processes and streamline workflows.
When it comes to round-robin distribution, there are a few ways that developers can implement it using Apex. One approach is to leverage formula fields to calculate an auto-number value. Using a combination of formula fields and the Apex modulo operation (Math. mod), developers can calculate a value that can be used to distribute records, such as leads or cases, equally among a group of sales or support reps. While this approach is highly customizable, it requires significant development efforts and may not be ideal for businesses without a dedicated development team.
Another approach involves using custom objects to create “slots” in multiple round-robin queues. Each record, such as a lead or case, is assigned to a specific slot within the queue, and the round-robin algorithm distributes the records among the appropriate teams or individuals. This approach requires more setup and configuration but provides a scalable solution that can accommodate larger teams and more complex routing rules.
Challenges with APEX code
Salesforce Apex code is known to be complex and difficult to support over time, especially under unforeseen or uncertain circumstances. Here are some challenges that companies often face:
- Developers need to write and maintain the code. It can become challenging if the original developer leaves the organization or hands the project off to a new team.
- While round-robin assignments can distribute work evenly among team members, it may not always be the most efficient approach. For example, some team members may have more expertise in a particular industry and can handle certain types of work more efficiently than others. A more targeted approach that assigns work based on skills and experience may be more effective in such cases. Although it’s not completely impossible, developing Apex code for such complex processes might sometimes take days or weeks.
- Sales motions are subject to change with evolving market conditions. Updating the code to align with these changes can be time-consuming and delay the implementation of sales strategies. This can also lead to a lack of agility in responding to changing market dynamics, as the code may need to be rewritten every time the workflow changes.
- Even small changes to the workflow can require a lot of time and effort to implement using Apex code. This can significantly drain resources and may slow down the development process.
Round Robin Lead Assignment with Salesforce Flow
Salesforce Flow offers a powerful alternative to using Apex code for businesses looking to streamline their processes and workflows on the Salesforce platform. Salesforce Flow provides similar flexibility to Apex code without the need for extensive coding expertise.
Additionally, Flow enables more complex routing logic, allowing businesses to assign leads to separate groups of reps in different territories. It ensures that leads are distributed fairly and efficiently, maximizing sales opportunities and customer engagement.
Challenges with Salesforce Flow
While Salesforce Flow offers many benefits for businesses looking to streamline their workflows, some potential challenges should be considered before implementing this custom solution.
- The Flow requires custom objects and Lead assignment rules to support it, which may be a source of discomfort for some admins. Setting up and maintaining requires additional time and resources, deterring businesses that prefer simpler, out-of-the-box solutions.
- Flow is a custom solution; it requires ongoing maintenance and support from your team, creating additional overhead and costs associated with development, updates, and bug fixes.
- Flow may not be suitable for businesses with complex workflows or requiring extensive customization. In some cases, Apex code may be a better option for businesses requiring more granular control over their workflows or integrating with other systems or applications outside of Salesforce.
- Flow can require sorting out some tricky logic, similar to programming. It can be challenging for admins who are uncomfortable with complex technical concepts and may need additional time and resources to understand and configure fully.
The Bonus Method
Creating a custom round robin assignment workflow in Salesforce can be challenging, especially if you don’t have the coding expertise to create a custom solution. Even if you do, maintaining that code over time and tweaking it to align it with your sales motions limits its scalability.
But with PowerRouter, you don’t need to worry about that. Our no-code solution makes it easy to create, configure and optimize your round robin assignments in Salesforce without the need for any coding expertise.
With PowerRouter, you can enjoy a flexible and scalable solution that can handle even the most complex routing rules, all while minimizing your maintenance and support needs. So why waste time on cumbersome coding or configuration when you can simplify your round robin assignment processes with PowerRouter?