Tuesday, February 24, 2015

Round Robin Lead Assignment Routine

There are two most popular Assignment Routines to assign new Leads to Sales Representatives: Lead Bucket and Round Robin. Both have it's PROS and CONS but in case if you wants to automatically distribute and assign incoming Leads to the members of your Sales Team you may want to use "round-robin" allocation process.

Pure "round robin" technique assumes that you want to divvy out all new Leads equally among the Reps in the Sales Team. Let's say you have three Sales Reps. In this case Lead_1 will go to Rep_1, Lead_2 will go to Rep_2, Lead_3 will go to Rep_3, Lead_4 will go to Rep_1 (!),  Lead_5 will go to Rep_2 and so on.

One of our customers gets about 300 Leads per day submitted to Salesfroce from Web site through Web-to-Lead form. Sales Team has about ten Sales Reps with different level of experience (including Interns, Senior Reps and Sales Reps with less skill).

BUSINESS REQUIREMENTS: Create Assignment Routine to automatically assign Leads (based on "round-robin" logic) with ability to easy activate/deactivate Reps (from round robin cycle if the Rep is sick or on vacation) and set it's Share - as a % of the total Leads received from Leads Queue during the day ("not equal share" feature).

Let's review all possible "round robin" solutions which could meet the requirement (fully or partially) along with implementation details and all its PROS and CONS.

Update 06/08/2015: Please also see Custom Salesforce Round Robin Incidents Assignment Routine for BMC Remedyforce

#1 Auto Number field and Lead Assignment Rules

We want to present this option as a "native" Salesforce solution which does not required any APEX coding. Here is a plan for Sales Team with 3 members:
  1. On the Lead object create new "Lead RR Number" field (Data Type: Auto Number, Display Format: {0}, Starting Number:1
    As a result every new Lead will get an unique number with 1 as an increment.
  2. On the Lead object create new "Lead RR ID" field  (Data Type: Formula, Formula Value: MOD(VALUE({!Lead_RR_Number__c}),3) +1
    Formula will return number from 1 to 3 depend on value in "Lead RR Number" field.
  3. Create 3 new Lead Assignment Rules with criteria for the rule entry as following:
    Lead: Lead RR ID equals 1 / User to Assign the Lead: Rep_1; Lead: Lead RR ID equals 2 / User to Assign the Lead: Rep_2; Lead: Lead RR ID equals 3 / User to Assign the Lead: Rep_3
    Activate new Rules and check how the solution works in action. Every new created user suppose to be assigned to Sales Rep as per expected "round robin" logic.
PROS: Use only SFDC native "out of box" tools to build
CONS: Bulky, quite complicated and time consuming to manage. Every time when you want to add/delete/activate/deactivate the Rep in the Sale Team you have to edit the formula and Assignment rules. Easy to make a mistake and compromise the assignment flow. Can't support "not equal share" requirements.

#2 Custom Force.com solution with new object and APEX trigger

After careful consideration we proposed and built following Force.com solution which meets all requirement.

SOLUTIONS DETAILS:
1) New Custom object "Sales Representatives" to keep info about Users involved in "round robin" assignment flow.
Consist of following fields:
 - User (lookup to User)
 - Status (Active/Inactive)
 - Split Weight (number from 1 to 100)
 - Split % (dynamically calculated based on number of Active users and their "Split Weight". For instance if you have 3 active Users and their Split Weight set to 20/30/30 their Split % will be calculated as 25%/37.5%/37.5%)
 - Next Assign To (check box to dynamically show who will get next Lead from Queue)
 - Today's Score (number of assigned TODAY Leads)

In SFDC interface Administrator can easy amend the Weight and Status for each user. Also he has an ability to add/delete records (Sales Reps) in the object.

Round Robin Lead Assignment Routine













2) Trigger SplitCalculation to auto recalculate Split % for each active user if Split Weight or Status of any User changed. Split % for each inactive user to be set to 0. Split % will be used in assignment logic.

3) Overnight job (at 0:00) to reset all users Today's Score to 0.

4) Trigger  LeadAssignment (before insert) to fire for each created Lead (some filters could be applied). Trigger (and dedicated Helper class) does following:
 - assign  the  Lead  to  the  User  who is next in the line (based on Next Assign To check box)
 - update assigned User's Today's Score based on number of assigned today Leads (+1)
 - identify Next Assign To User as per following logic (assigning  Lead to the users on a round robin basis. Count Users score and skip User if he's got as much Leads to hit his User's Split %).

PROS: Meets ALL Business Requirements
CONS: None. Required new object and some APEX coding.

Please do not hesitate to contact us if you want to leverage this solutions in your Saleforce instance.

#3 App by Salesforce Labs: Round Robin Record Assignment

Advanced Salesfroce users with Administrator experience might want to install and amend the Round Robin Record Assignment app from Force Labs. This free solution was built to manage Cases assignment. But APEX code is open to modify. So with some experience and knowledge you can amend the app to work with Leads object. 

PROS: Free app from Force Labs. Has some extra features.
CONS: Does not support "not equal share" requirements. Has some limitations and average 3.7 of 5 stars reviews.