Create Rules to Assign Accounts to Territories

Automate assignments of new and updated accounts to territories using rules that you create and run. The rules identify characteristics that you use to define that territory, and tell Sales Territories to assign accounts with those characteristics to that territory. Salesforce assigns accounts to territories according to your rules when you create or update an account, but only if your territory model is in Active state.

Required Editions

Available in: Salesforce Classic for some features and Lightning Experience for all features
Available in: Performance and Developer Editions and in Enterprise and Unlimited Editions with Sales
User Permissions Needed
To view the assignment rules: View Setup and Configuration
To create or edit assignment rules:

View All Records on Accounts AND Manage Territories

AND

View Setup and Configuration OR Customize Application

Note
Note Users with the View Setup and Configuration permission can access assignment rules because that permission grants read access to the rule records.
Tip
Tip Don’t assign a rule to a territory if that rule is a child of another rule that’s already assigned to the territory. To find out what rules apply to a territory, open the territory’s record detail page and look at the Assignment Rules Assigned to this Territory related list. If a rule has Apply to Child Territories selected, don’t assign the rule separately to child territories.
  1. From the territory model hierarchy, open the territory where you want to create a rule.
  2. On the detail page, in the Assignment Rules Defined in this Territory related list, click New.
  3. On the rule edit page, enter a name for the new rule and define selection criteria.
    If your org has enabled state and country picklists, territory assignment rules using states as a criteria must use contains matching instead of equals matching.

    Keep in mind that ZIP/postal codes are alphanumeric fields, not number fields, so in a comparison, 9 is “higher” than 80000, for example.

  4. If you also want the rule to apply to the current territory’s descendants, select Apply to child territories.
  5. If you want the rule to run when a user creates or updates an account, select the Active checkbox.
    For account updates, territory rules run only when these conditions are true.
    • If you update the account in Salesforce, select Evaluate this account against territory rules on save and assign the rule to a territory in the active territory model.
    • If you update the account via API, specify AssignmentRuleHeader.

    For account inserts, select Run territory assignment rules during account inserts in Territory Settings.

  6. Click Save to save the rule and return to the territory detail page.
Example
Example Rules can work together within territories and child territories. For example, you create a territory called Western States, with child territories Washington, Oregon, and California. From the Western States territory record, you create a rule that assigns accounts in Washington, Oregon, and California to that territory. You apply that rule to child territories and then, from the California territory record, you create a rule that assigns accounts in California to the California territory.

If you mark the California territory rule as inheritable, you don’t have to specify the state in the criteria for child territories. Instead, you can use more specific criteria, such as ZIP code or industry.