---
schema_version: "1"
id: d4936b59f99a9d991bbbfcf96f5facdb5314affce6628507d6b7de84087f19ab
title: Create Rules to Assign Accounts to Territories
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/sales/264-0-0/tm2_assign_accounts_by_rules.md
canonical_url: https://help.salesforce.com/s/articleView?id=sales.tm2_assign_accounts_by_rules.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 90ce8325143fa43f6ae3a2b34bbcac5452b790670b6a134d970a8890491fbc49
description: 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.
products:
  - Sales Cloud
release: "264"
---
# 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

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Salesforce Classic for some features and Lightning Experience for all features</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Performance</strong> and <strong>Developer</strong> Editions and in <strong>Enterprise</strong> and <strong>Unlimited</strong> Editions with Sales</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d59424e73">User Permissions
              Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d59424e73 ">To view the assignment rules:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d59424e73 ">View Setup and Configuration</td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d59424e73 ">To create or edit assignment rules:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d59424e73 ">
              <p>View All Records on Accounts AND Manage Territories</p>
              <p>AND</p>
              <p style="margin-bottom:0;">View Setup and Configuration OR Customize Application</p>
            </td>

          </tr>
        </tbody>
      </table>

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sales-sales_core-264-0-0-production-enus/3c339c40-ca6c-49ba-9c6e-684be7a55f80/images/icon_note.png)

Note Users with the View Setup and Configuration permission can access assignment rules because that permission grants read access to the rule records.

![Tip](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sales-sales_core-264-0-0-production-enus/3c339c40-ca6c-49ba-9c6e-684be7a55f80/images/icon_tip.png)

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](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_header_assignmentruleheader.htm).
    
    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](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sales-sales_core-264-0-0-production-enus/3c339c40-ca6c-49ba-9c6e-684be7a55f80/images/icon_example.png)

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.

#### See Also

- [How Do Permissions for Territories Affect Feature and Data Access?](https://help.salesforce.com/s/articleView?id=sales.tm2_how_access_permissions_work.htm&release=264.0.0&type=5 "Anticipate how permissions for Sales Territories affect administration and provide access to records and data.")
- [Run Assignment Rules for a Territory](https://help.salesforce.com/s/articleView?id=sales.tm2_run_assignment_rules.htm&release=264.0.0&type=5 "Run account assignment rules for any territory that has rules defined and belongs to a territory model in Planning or Active state. When you run rules from Setup, accounts are assigned to territories according to your rules if your territory model is in Active or Planning state.")
- [How Account Assignment Rules Work](https://help.salesforce.com/s/articleView?id=sales.tm2_how_assignment_rules_work.htm&release=264.0.0&type=5 "Before you create and use account assignment rules, make sure that you review how they work.")
- [Activating Assignment Rules and Applying Them to Descendant Territories](https://help.salesforce.com/s/articleView?id=sales.tm2_assignment_rule_activation.htm&release=264.0.0&type=5 "The ability to apply an assignment rule to descendant territories is available at the territory level only. You can’t apply assignment rules to descendants at the territory model level. The only option you get is to apply a rule to descendant territories if you access the rule’s record from an individual territory.")