Loading

Territory Management Assignments via Zipcode

Дата публикации: Aug 25, 2025
Описание

Territory Management Assignments via Zip code.

Note:  
Original territory management and Enterprise Territory Management both support territory definition and assignment utilizing zip code. For assignment rules involving zip code, you can use a range with the Is Greater than and Is Less than operators, patterns with the Contains operator, or enumerated zip codes with the Equals operator. When using the enumeration method, be aware that the number of zip codes that can be included is subject to the 1,048 character limit of SoQL. Below are some suggestions for managing territory assignment involving large amounts of zip codes.

 

 

Решение

1.   Territory assignment rules are accessible through the API, so you could maintain the definitions in these Excel spreadsheets as you're presently done and anytime you need to update, run an update via data loader based on your changes in spreadsheet, eliminating the extra step of cutting and pasting. 

2.   Another efficient approach in terms of managing a large volume of zipcodes is to create a custom object that contains these zipcode definitions.  Each entry in the custom object maps a zipcode against a territory name. Create a lookup relationship between the account and the custom object that represents a custom zip code field on the account.  Then create a cross-object formula on the account that references the territory name on the custom object for the corresponding zip code selected, such that every time a user fills out the custom zip code field, the cross-object formula field is automatically populated with the territory name. Instead of defining your territory rules based on zip codes, write your rules based on the territory name in the formula field. A couple of advantages: 

1) Your territory assignment rules are much more concise,

2) You have a table-driven approach to maintaining your zip code definitions (pretty easy to go into your custom object to edit the single zip code-territory mapping entry if you have a realignment of territories). 

3) You don't have to contend with character limits in your assignment rules (zip codes are stored in the custom object, so you can store as many as you need, 4) automatic data quality enforcement (the zip code has to be a valid entry in your custom object). 

4) Con: You have to use a custom zip code field as opposed to the standard zip code field that's part of the address field.  This design can take on many permutations to fit various scenarios - it depends on the use case.
 

3.   This solution builds on the table-driven approach above, but leverages apex, instead of the cross-object formula field and custom zip code field.  Here's the flow:  user fills out standard zip code field as usual, apex triggers are invoked on new account creation and update, performs a lookup against your zip code mappings in your custom object, and updates the custom fields that represent account-territory relationships.  Your territory assignment rules evaluate the custom field on the account that's updated by apex, and assigns the account accordingly.  All the advantages above, in addition to being able to continue using the standard zip code field.  And it's pretty easy to have custom validation via apex so that a user can only use a zip code that you've defined in your custom object.
 

Consider voting on the idea exchange for this idea.

Номер статьи базы знаний

000385599

 
Загрузка
Salesforce Help | Article