How do Territory Planning simulations help operations teams design optimal sales territories?
Answer
Basics: A territory model holds territory types, a hierarchy, and account assignment rules. Models have states: Planning, Active, Archived. Only one model is Active; others let you experiment without affecting sales.
How it works:
- Clone the Active model or create a Planning model.
- Define territory types and the hierarchy; add rules with criteria on Account fields (for example region, revenue).
- Run assignment rules; Salesforce populates account-to-territory assignments within the model.
- Review results: reports on territories and accounts, check coverage gaps, overlaps and counts.
- Add forecast users and opportunity assignment logic.
- Activate the model. This makes it the live model and the former Active model becomes Archived; sharing recalculates.
Advanced / deep dive: Territory models allow multiple territories per account, so overlaps and coverage need explicit checks. Activation triggers sharing recalculation, which can take time on large orgs; schedule off-hours. Limits on models by edition exist (verify in current docs). Opportunity territory assignment follows either the account's territory or a custom Apex filter implementing TerritoryMgmt.OpportunityTerritory2AssignmentFilter for logic such as choosing the highest-priority territory. Rolling forward across fiscal periods means cloning and reactivating, since quotas and forecasts tie to the active model. Salesforce Maps adds map-based territory design and analysis. The original Territory Management is legacy; verify its status for your org.
Code / config example:
global class OppTerritoryFilter implements .OpportunityTerritory2AssignmentFilter {
global Map<Id, Id> {
Map<Id, Id> result = <Id, Id>();
Map<Id, Id> oppToAcct = <Id, Id>();
(Opportunity o : [SELECT Id, AccountId FROM Opportunity WHERE Id IN :oppIds])
oppToAcct.put(o.Id, o.AccountId);
Map<Id, Id> acctToTerr = <Id, Id>();
(ObjectTerritory2Association a : [SELECT ObjectId, Territory2Id
FROM ObjectTerritory2Association WHERE ObjectId IN :oppToAcct.values()])
(!acctToTerr.containsKey(a.ObjectId)) acctToTerr.put(a.ObjectId, a.Territory2Id);
(Id oid : oppToAcct.keySet())
(acctToTerr.containsKey(oppToAcct.get(oid))) result.put(oid, acctToTerr.get(oppToAcct.get(oid)));
result;
}
}