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?

Parents
  • 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.

Reply
  • 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.

Children