Hello Friends, In the last chapter we learnt about the concepts of Enterprise Territory management. Now in this article we will set it up.
Step 1: Enable the enterprise territory management
Step 2: Build Territory Model
- Territory Types
- Territory Priority
- Territory Model
Step 3: Create Territory Hierarchy
Step 4: Assign Account to territories
- Automatic Assignment
- Manual Assignment
Step 5: Assign uses to territory
Step 6: Activate Territory Model
Step 1: Enable enterprise territory management
Enable Enterprise Territory Management
Click on Setup -> Territories Settings, and then click on the Enable Enterprise Territory Management button
Territory is a group of accounts and users. So, the users in the territory will have at least read access to the accounts. Territories will also provide access to those standard objects that are related to accounts in a master detail relationship. So, that is the reason we have opportunity, but not leads in territory settings.
The users in the territory will automatically have at least read access to account and also access to the related opportunities and cases. Here we define the default access level. However, this doesn’t apply to all the territories because we can set the access level separately for different territories.
Notice that there is no option for giving “no access “ on account. But for opportunities and cases, we have “no access” option. That option is not there on account because the users will have at least read access to all the accounts.
Opportunity Territory assignment
Feature of Opportunity Territory assignment is used for assigning opportunities to territories and for this apex class is used. For enabling this feature, we need to create the apex class with the logic and then assign that apex class and enable the feature.
Step 2: Build Territory Model
Territory model organizes the elements of the organization’s territory management in one place. It compromises of territory hierarchy, account assignment rules, user assignments, everything in one place.
- Territory Types
- Territory Priority
- Territory Model
So first, let’s create territory types. Territory type is dependent on the business requirements. We can have direct accounts or partner accounts or customer accounts or based on selling, like high selling accounts.
Here, I have created Partner Account and Customer Account
Territory priority
It is defining the priority of that territory. There, is a no predefined specification of how the priority should be. So I have given partner account, priority-100 and customer account, priority- 101.
Territory model
Now let’s go ahead and create territory model. Territory model groups all the components within that.
I have added the company name in the Territory model.
There are three states in our territory model:
- Planning
- Active
- Archived
Whenever we create a territory model, it automatically falls in the planning state and once we complete the entire set up, finally we activate it. Only one territory model can be in the active state.
If you click on View Hierarchy, you will be able to see the empty structure.
We have just created the model. We haven’t created any territories or any rules. We have just created that outer structure and we are yet to create all our components within that.
Step 3: Create Territory Hierarchy
We are now going to create territories and then create the territory hierarchy.
Go to territory Model -> Click on Label (Verizon) -> View Hierarchy -> Click on Create Territory
Every company has its own criteria in which their territory is defined like by location, by industry or by other custom fields. Here, we have already created a model called “Verizon”. Now, we are creating territories within that like Eastern US, Western US, Central US.
Territory type is a mandatory field for creating a territory which we have already created in previous section.
Also, while initially setting up the Enterprise Territory management feature, we set up the default access levels. However, each territory we’ll be able to set up the access levels.
I have added Central, Eastern and Western US Territory.
Under Western US Territory I have added child territories i.e. California and Seattle. California and Seattle are sibling territories as they are at same level.
Step 4: Assign Account to territories
We can assign Account to territories in two ways:
- Automatic Assignment
- Manual Assignment
Automatic Assignment
It is automatically assigning the accounts to territories based on certain criteria.
For automatic assignment, we will be creating rules. And the rules will be defining the criteria through which accounts are to be assigned to territories, and whenever the account is created or edited, this rule will be evaluated and based on that, the account will be assigned to that particular territory. So that is called automatic assignment.
Click on Territory in which you want to assign account -> Besides “Assignment Rules Assigned to This Territory” click on “New” button
Add the logic by which you want to assign account to that territory. I have added that if Account: Billing State equals to California then add to California Territory.
Creating rule will not make assignment happen, we need to run the rules. Click on “Run Rules” beside the territory.
Manual Assignment
Manual assignment is manually assigning an account to territory.
Click on Add Accounts
Select Checkbox besides account you want to assign and click assign
We can assign a single account to multiple territories or can assign multiple accounts to a single territory.
Step 5: Assign uses to territory
Users will have access to the accounts to sell their products and services.
Click on “Manage Users” and assign all the appropriate users to the particular territory.
Step 6: Activate Territory Model
The final step is to activate our territory model.
Opportunity Territory Assignment Filter
If we want to assign opportunities to territories, only then we need to implement with this step. For opportunity assignment, logic is given in the apex class, which will help us assign the opportunities to territories.
Salesforce has given an example apex class to implement in their document. We can add the class
OpportunityTerritory2AssignmentFilter Example Implementation
Manually Exclude an Opportunity from Filter-Based Territory Assignment
We can exclude a specific opportunity from filter-based territory assignment.
For this we need to select a checkbox on the opportunity record. “Exclude from the territory assignment filter logic”. By selecting this field, we can exclude the opportunity record from the territory assignment.
I hope this article helped in clearing your doubts regarding territory setup in Salesforce. Subscribe to the blog and sfdcamplified YouTube channel to get more material like this.