Looking for PowerObjects? Don’t worry, you’re in the right place! We’ve been part of HCL for several years, and we’ve now taken the final step in our acquisition journey: moving our website to the HCL domain. Nothing else is changing – we are still fanatically focused on Microsoft Business Applications!

PowerObjects Blog 

for Microsoft Business Applications

|

Round Robin Lead Assignment in Microsoft Dynamics CRM 2011

Post Author: Joe D365 |

Here's a scenario involving a sales team dealing with round robin lead assignment. Let's say a sales department is currently receiving leads via their website using a custom Web-to-Lead component. When these leads are received, they are assigned to a Sales Coordinator for distribution to the sales team. The business receives hundreds of leads per day via their website so a lot of the Sales Coordinator's time is spent assigning these leads to the sales folks. The sales leaders are concerned that too much of their Sales Coordinator's time is being devoted to assigning leads.

Let's say that the leads are assigned on a rotating or 'round-robin' basis. After a lead is assigned to Salesperson #1, she goes to the 'back of the line' and the next lead is assigned to Salesperson #2. After being assigned the lead, Salesperson #2 goes to the back of the line and Salesperson #3 get the next lead, and on and on it goes…

Our first instinct is to create a plugin to solve this issue. With a plugin we could reference a 'counter file' which would keep track of the next salesperson to receive the created lead. Plugins can (sometimes) be costly to develop, though, so is there another way to do this type of automatic assignment?

This may seem like a difficult request since a workflow doesn't have any 'context.' The workflow doesn't know if it is the first time that it is running or the fiftieth. We also can't access a reference file via a workflow (out of the box). Surely a plugin would be the only way to do this, right???

Sounds like a business problem! Let's solve it!

THE SOLUTION

As stated above, a workflow doesn't have any 'context'. There is no way to specify in the workflow that if this is the third time the workflow is running assign the lead to Salesperson #3 and if it is the fourth time it is running assign the lead to Salesperson #4. One thing a workflow CAN do, however, is access a related parent record.

With that piece of information in mind I was able to do the following:

Create a new entity called 'Counter'. This entity only has one attribute: Counter Number.

round robin lead assignments

> This new entity will have a 1:N relationship to the lead entity
> There will ONLY ever be 1 counter record in the system. We will update this record in the workflow

With this new parent entity in place, we can now create a workflow that does a CHECK CONDITION on this counter entity.

> If Counter = 1, assign lead to Salesperson 1
> If Counter = 2, assign lead to Salesperson 2
> If Counter = 3, assign lead to Salesperson 3

Before we can do the check condition in the workflow we first need to relate the lead to the counter entity. We do this by doing an UPDATE step as the first step in the workflow

Note that we hardcoded the reference to our Counter record. We DID NOT use a dynamic value.

Now that we have the connection to the counter created, we can now do our check condition as the next step in the workflow:

After the check condition, we then do our ASSIGNMENT step

After assigning the lead, we now need to increment the COUNTER by 1:

NOTE: notice that we did not do a dynamic value here, we hardcoded the value.

We now would create check and assign conditions for when the Counter equaled 2, 3 and so on…

When finished, your workflow will look something like this:

Finally, set your workflow to run automatically on record create and you are all set!

So there you have it: a round robin workflow assignment process created easily with a workflow. No need for custom plugins or extensive development. If you think this is cool and want to work with the Microsoft Dynamics CRM Experts at PowerObjects – let us know we'd be happy to be your experts as well!

Happy CRM'ing!

Joe CRM
By Joe D365
Joe D365 is a Microsoft Dynamics 365 superhero who runs on pure Dynamics adrenaline. As the face of PowerObjects, Joe D365’s mission is to reveal innovative ways to use Dynamics 365 and bring the application to more businesses and organizations around the world.

3 comments on “Round Robin Lead Assignment in Microsoft Dynamics CRM 2011”

  1. Hello,
    I`m trying to do it but nothing happened. Once it skipped the `if` and I got: the assigned record was not found.
    I re-write the all thing and it is still doesn`t work. it seems that it doesn`t recognize the 'lead round robin' entity field (in my case called `name`). What am I missing?

  2. Tried to implement this method but there is a problem because workflows are run asyncronously. If two leads are created at the same time (or relatively close together within seconds), the workflow fires twice and both instances of these jobs see the value "1" when it hit the check condition. The result is both of these leads are assigned to sales person "1".

    Since there doesn't seem to be a way to set a workflow to run one after the other, queued, what is the solution to this?

PowerObjects Recommends