Assign leads based on zip code range

Hello,

My client is currently running SugarCRM Professional 6.5.12. They want to associate their US sales reps with territories, and those territories are defined by zip code ranges.

For example, you might have a rep who handles all of northern California (9320---93601, 93399---96699), northern Nevada (89301---89999), and New Mexico (87001---88441).

I created a new workflow definition for this, and created a condition where Primary Address Postalcode Equals 00000. I then created an action where the lead is then assigned to 'Administrator'. This workflow works properly, and if reps were simply assigned by state, I could enter 50 static conditions and 50 static actions this way.

Since the workflow condition only accepts 'equals' or 'does not equal' as operators, I can't use this to define zip code ranges. Is there another way I can accomplish this goal? Would it require upgrading?

  • Hello Morgan,

    This type of requirement should be possible through the use of the Advanced Workflow functionality found in the Enterprise edition of Sugar 7.x. More information about Advanced Workflow is available on our Support site.

    However, Advanced Workflow does come with these requirements:

    1. A currently supported version of Sugar 7, as you are hosting Sugar yourself or through a third-party service, that would be 7.9.3.0. Upgrading from 6.5.x to 7.9.3.0 is a significant change and includes upgrading components of the web server stack that is hosting the Sugar file system and database.

    2. Enterprise edition, Advanced Workflow is not included in the Professional addition. Enterprise does come at an increased cost per User.

    Alternatively, if you have a Sugar Developer you can work with, it may be possible to build a logic hook that performs the required task. The logic hook would be custom PHP code, rather than something that is done through the user interface. If you don't have a Sugar Developer you can work with right now, I would definitely recommend reviewing our Reselling Partners list.

    Regards,

    Dan Kallish

    Advanced Support Engineer

    SUGARCRM

    Learning Resources: http://support.sugarcrm.com | http://university.sugarcrm.com | http://community.sugarcrm.com

  • Hi Morgan Nunan,

    Brainstorming about this, knowing this is not a function of any one feature out-of-the-box in Pro 6.5, two ideas initially occur to me. One required custom development, and one might be possible without custom development.

    With Custom Development

    A logic hook can be encoded to match users to ranges upon record save. However, one caveat to keep in mind is that the logic hook would have to be changed at a code level any time your users or the correlation between user and range changes.

    As an ideal, I envision a custom Admin menu screen that allows you to specify users and corresponding ranges. Then a logic hook could match these values as variables instead of hard coded values. This would fulfill the logic hook approach while giving you an interface to keep it up to date.

    Using Only Features Sugar Offers Out-of-the-Box

    Understanding that zip codes are a fairly static thing, and making an assumption the defined ranges will be static, I imagine the following as a possible solution:

    Note: I have not tested or built out any of this specifically to confirm it could work

    1. Create a custom Textfield in the module for ZIP Code Ranges (I am suggesting a textfield instead of a dropdown because you can calculate a textfield, but you cannot calculate a dropdown type field).

    2. Write a calculation using Calculated Fields that sets the field in step#1 to a specific range value depending on the value in it.

    3. Configure a workflow to assign a specific user based on the field in step#1 equalling a specific value.

    My goal with this note is to brainstorm with you. I hope this is helpful.

  • Thanks for the idea, Patrick. I will talk to my client, and if we choose this route (with calculated fields), then I will report back on the results.