You can assign leads based on zip code in Microsoft Dynamics CRM many ways, but the two most common ways are with workflow and with custom plugins.


Workflow to Assign Leads Based on Zip Code

For those with a simple zip code to sales person mapping, workflow can be used to map Leads. In order to do this, one must be specify each particular Zip or postal code (or the first character of each zip code) and which user it maps to. In the example below, I have used a simple example: If the Zip code starts with 5, then assign the Lead to this individual.

Assign Leads Based on Zip Code in CRM 2011

Now, it would be nice if every sales territory was this simple as “the zip code starts with 5”, but generally they are not that cut and dried. That is why many organizations require a lookup table to store their complex zip code matrix. Within MSCRM, workflow doesn’t have the ability to look up a value in a table, and that is where a custom plugin comes in.

Custom Plugin to Assign Leads Based on Zip Code

To creating a lookup table of the zip code assignment matrix, we simply create an entity in CRM to store the Zip codes and who owns that Zip Code. Other attributes of the Zip Code such as the County, Region, or Territory name may also be stored in this table. Some organizations may subscribe to Zip Code database from which new Zip Codes should be imported periodically.

Having the Zip Code lookup in a CRM entity in provides multiple benefits. First of all, it can be used to initially assign a Lead using a custom plugin. Here, when a new lead is entered and the record is saved, the plugin looks up the Zip Code and fills in the appropriate Owner. A plugin can incorporate custom logic if a zip code is owned by multiple users, such as a Zip Code that goes across multiple Counties.

But this kind of functionality it is not limited to Leads. With a little code change, the same plugin could be adapted to Accounts, Contacts, Campaign Responses or any record in the system with an address.

Secondly, plugins could be written to realign the sales territories and ownership based on zip code. In the example below, multiple zip codes are selected and ownership can be changed using the Assign button. An optional plugin may change the ownership of the records based on this change. Some organizations have this change be conditional, for example active customers and prospects may not be changed, but new leads that have not been touched in 6 months may be reassigned to the new Owner.

Making the Right Choice

The benefit of using a workflow for the Zip Code assignment is that an intermediate user can maintain the logic without involving a programmer. This is the preferred option if the Zip code matrix is simple such that creating the workflows to manage the territories is not too laborious. A combination of Advanced Find queries and workflows can often be used to change the Ownership of groups of records if Zip Code assignments change.

However, if the Zip Code assignments are complex, don’t shy away from a custom plugin to manage the process. A flexible solution can be designed for an organizations unique need and can help save a lot of time over the long term.

If you need help deciding on the right path or are just looking for a great MSCRM partner to work with – reach out to us and we would love to earn your business.

Happy CRM’ing

Avatar for Joe D365

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.