Managing Account Assignment Rules
Create account assignment rules that automatically move accounts and their associated opportunities and cases into territories based on any standard or custom account field, such as zip code, state, industry, revenue, or number of employees. Each rule consists of multiple rows of criteria that specify exactly how the accounts are assigned.
Account assignment rules are governed by the following:
A territory can have inherited account assignment rules, meaning that the rules were created somewhere higher in the territory hierarchy and consequently also impact the given territory.
A territory can have locally defined account assignment rules, meaning that the rule was created at the given territory.
If a territory doesn't have any inherited or locally-defined account assignment rules, then it only contains accounts that were manually added.
If an account matches all inherited and locally-defined account assignment rules for multiple territories on the same branch of the hierarchy, then the account is assigned to the lowest matching territory.
If an account matches a territory's inherited account assignment rules but not all of the territory's locally-defined rules, then the account isn't assigned to the territory, but is evaluated for child territories.
If a territory has multiple locally-defined account assignment rules, an account is assigned to the territory only if it matches all locally-defined account assignment rules on the territory.
For example, you have three territories:
Territory A has four rules marked “Apply to child territories“, and is a parent of territory B.Territory B has three rules not marked “Apply to child territories”, and is a parent of territory C.Territory C has two rules.
If you assign an account that matches all of territory A’s and territory C’s rules but only one of territory B’s rules, then the account is assigned to territory C. However, if territory B's rules are marked “Apply to child territories,” then the account is assigned only to territory A.
Working with Account Assignment Rules
Click Run Rules on the territory detail page to evaluate the active inherited, locally defined rules shown on the page against all existing accounts in your organization. The rules for all subordinate territories are also evaluated—that is, when you run rules on the top-level territory, all rules in the entire hierarchy are evaluated. When you click Run Rules, an icon ( ) displays next to the button for all affected territories to indicate that rules are being processed. An email confirmation is sent when processing is complete.
NOTE To protect data quality, you can't modify a territory while the processing icon displays.
Click Manage Rules on the territory detail page to access the Manage Account Assignment Rules page, where you can create, edit, preview, and run account assignment rules:
Click New to create a new rule, or Edit to edit an existing rule. See Create and Edit Account Assignment Rules.
Use the Active checkbox to set a locally-defined rule as active or inactive.Active account assignment rules automatically evaluate accounts and assign them to territories when:
An account is created using the Salesforce user interface, the Lightning Platform API version 20.0 or earlier, or a client such as Connect Offline.
An account is imported using an import wizard.
An account is created by the conversion of a lead.
An account is edited and saved if the Select by default checkbox is selected for the “Evaluate this account against territory rules on save” checkbox option under Layout Properties. If the account assignment rule initiates an opportunity ownership change, you must have transfer access on the opportunity.
An account is edited and saved via the Lightning Platform API.
Run Rules is clicked on a territory detail page, provided the Exclude from territory assignment rules checkbox on the account is deselected.
Save & Run Rules is clicked on the manage account assignment rules page for a territory, provided the Exclude from territory assignment rules checkbox on the account is deselected.
Duplicate accounts are merged.
Click a rule name to see the details of that rule, including its active status and criteria. From a rule detail page you can edit, delete, or clone a rule.
Click Preview to see the accounts that would be assigned to this territory and its child territories if the rules currently marked active were run. See Preview Account Assignments.
Click Save to save the current active status of locally-defined rules.
Click Save & Run Rules to save the current active status of locally-defined rules and evaluate the inherited and locally-defined rules shown on the page against all existing accounts in your organization. Running account assignment rules affects accounts in the Recycle Bin.
Click Edit on the territory detail page to toggle the Confine Opportunity Assignment checkbox. When it is selected, the territory's opportunities remain in the territory or its child territories when you run account assignment rules. The following exceptions apply:
If an opportunity's account moves to only one of the territory's children, then the opportunity follows the account and is reassigned to the account's new territory. This includes when an account moves to multiple territories and only one of the new territories is a child of the original territory.
If an opportunity's account moves to more than one of the territory's children, then the opportunity's territory field is set to blank.
If an opportunity's account moves completely out of the territory and its children, then the opportunity's territory field is set to blank.
TIP You can also manage account assignment rules using the Data Loader or the Web services API.
Account Assignment Rules and Opportunities
Several factors determine how account assignment rules assign opportunities to territories, including:
Whether the account associated with the opportunity is assigned to one or more territories
Whether the opportunity owner is a member of the same territory as the account
The number of users assigned to the territory
Whether a forecast manager is assigned to the territory