Loading

Run territory assignment rules when you edit an Account

Дата публикации: Jun 3, 2026
Описание

The administrator of an org with Enterprise Territory Management enabled wants territory assignment rules to run when Accounts are edited.


 

Решение

There is a checkbox that can be added to the Account page layout called "Evaluate this account against territory rules on save. 

Steps to Add Territory Checkbox to Page Layout


1. Setup -> Customize -> Accounts -> Page Layouts

2. Click Edit next to the page layout

3. Click the Layout Properties button at the top of the page

4. Check the "Show on edit page" checkbox next to "Evaluate this account against territory rules on save"

5. Optionally check the "Select by default" checkbox to auto-check the checkbox on the page layout

6. Click OK then save the page layout

Note:  Make sure Territory Model is Activated prior to changing the Territory Number(if Custom Territory Number field was used) for the Account Territory record to be available in Assigned Territories Related List.

The user can uncheck the “Evaluate this account against territory rules on save” checkbox on the edit page, and territory assignment rules will not be run.
 

Running Rules via Web Services API

 

As of version 21 of the Force.com Apex Code Developer's Guide, there is not a way to run territory assignment rules through Apex: "assignmentRuleHeader method - The database.DMLOptions object supports assignment rules for cases and leads, but not for accounts or territory management."

The only option as of API version 21 is to use the Web Services API. See AssignmentRuleHeader in the Web Services API Developer Guide for more information:

Limitations

"AssignmentRuleHeader – useDefaultRule - If true for a Case or Lead, uses the default (active) assignment rule for a Case or Lead. If specified, do not specify an assignmentRuleId. If true for an Account, all territory assignment rules are applied, and if false, no territory assignment rules are applied."

Note: 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.

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

000385116

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