function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
CyberfireCyberfire 

How to generate a specific range of numbers?

I'd like to have a field on leads which will be a formula which does this:

 

Lead is created: Starts with 1, and moves sequentially up to X (lets say 17), and starts over once it hits 17.

 

Essentially it would be like an autonumber field, but only goes up to a specified value, and only if the record is in a certain status.

 

The reason for this is because the way the round robin formula is right now in Salesforce, is that you can't specify an auto number to increment based on certain criteria.

jkucerajkucera

Easiest non-code way to do a pseudo round robin is to just to create the auto-number mod 17.

 

http://www.salesforce.com/community/crm-best-practices/marketing-professionals/demand-generation/lead-management/lead-sprinkler.jsp

 

Assuming you want to get more complex & change up the number frequently, you'd want to use some code based solution instead of a formula field for the mod calculation.

CyberfireCyberfire

Unfortunately, this doesn't work, and I'll explain why it doesn't work for a sales team.

 

Lets say that you have an auto number field of 215848. Lets assume you use their "Lead Sprinkler" formula, also known as the round robin.

 

Using 17 as the variable, you get this: Remainder = 16.

 

This means that the 16th person on the assignment rule (If round robin # = 16, assign to X), should get the lead. Unfortunately, this doesn't really work because of the following:

 

Variables: 17 people in the assignment rule

 

Web Lead                      - 216891     -   Remainder = 5         Assignment rule triggered

Manually Created Lead - 216892     -   Remainder = 6         NO assignment rule triggered - 6th person is skipped

Test Lead                       - 216892    -   Remainder = 7         NO assignment rule triggered - 7th person is skipped

Web Lead                      - 216893    -   Remainder = 8         Assignment rule triggered

Web Lead                      - 216894    -    Remainder = 9        Assignment rule triggered

 

In this example, 3 web generated leads came in. They should have gone to agent 5, 6, and 7. However, because the formula is dividing by an auto-generated number that increments with every created lead, it skpped 2 people.

 

As far as have been able to tell, there is no way to overcome this huge obstacle to creating an even remotely fair or equal round robin. I can't believe that I'm the only person to experience this problem.

jkucerajkucera

Are you saying the auto-number isn't incrementing all the time & sometimes has duplicates?  I'm not sure why 6 & 7 would be skipped in your example:

 

Manually Created Lead - 216892     -   Remainder = 6         NO assignment rule triggered - 6th person is skipped

Test Lead                       - 216892    -   Remainder = 7         NO assignment rule triggered - 7th person is skipped

 You could use a randomization function to assign a random number to each lead & assign based on those, but that can lead to "clumpy" results as some days 1 person will get a lot and others none.

CyberfireCyberfire

jkucera - That was a typo, sorry about that. The autonumber is always sequential, and doesn't skip.

 

 

jkucerajkucera

Ah - ok so your concern is how to skip test leads & ensure manually created leads are always routed correct? 

 

For manual leads, you can either train the reps to always check the "Optional: Assign using active assignment rule" checkbox on the edit page, or force reassignment w/ a before or after insert trigger.

 

For test leads, I don't have a good solution for you, but I'd hope there aren't a large enough volume of them to make a difference.

CyberfireCyberfire

I guess it's not too clear from my previous post, so I'll try to explain it better:

 

Business need: Assign leads of a certain record type sequentially, (aka "round robin") to agents via an assignment rule.

 

If you have an autonumber field with the standard "round robin" formula provided by SFDC, this does not work - it will skip around, because leads of a different type will increment the autonumber field, thus skipping over whoever the next lead of the qualified record type should have gone to.

 

If you have 3 record types, and only want the assignment rule to apply to a single type, it appears that SFDC has no solution.