I'm trying to implement lead assignment rules by country. So far, I have the proper countries going to the proper reps. All countries in Africa go to a special queue. I'm trying to assign the contents of that queue to the reps in a round-robin manner, so 1 2 3 1 2 3 etc. Is that possible?

Also, I'm trying to have any remaining leads after all of the assignment rules have run be added to the rep with the least amount of leads in the past month. How would I implement this logic?

  • 1
    the latter request is a trigger on Lead based on any lead assigned to a special queue 'Unassigned' that you create. After insert/update trigger can use DML and DMLOption to reassign lead based on soql query
    – cropredy
    Oct 2, 2015 at 19:37

1 Answer 1


How I've personally done this before -

  • create a hidden autonumber field on the lead
  • create a formula field that pulls the rightmost digit RIGHT(TEXT(autonumberfield), 1)

Then with that formula field of the right digit of the autonumber (0 through 9), use that value in the lead assignment rules to assign leads by a round robin. Unfortunately, ten is not divisible for three so this isn't exactly perfect for your scenario but it does accomplish what you're trying to do.

For the last part, I'm not sure that can be done through an assignment rule. That sounds like it would need to be a trigger as it would need to count the number of leads owned by each representative and then assign the owner, so the owner would potentially vary from month to month. Sorry, can't provide much more help on that topic :-/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .