Salesforce Admin ADM-211 – Security and Access : Enterprise Territory Management Part 2
- Assigning Accounts to Territories
Now that we have successfully created our territory hierarchy. Now let’s understand how to assign accounts to territories. As we already discussed, we are now here basically we started with enabling the feature and then building a model wherein we created territories and finally formed a territory hierarchy. So the next step is to assign accounts to territory and after that we’ll be basically assigning users to territories because territory is basically a group of accounts and users. So for assigning accounts to territories in Salesforce, we have two different methods.
One is the automatic assignment. So automatic assignment as the name says, it is automatically assigning the accounts to territories based on some certain criteria. So for automatic assignment we’ll be creating rules and in the rules we’ll be defining the criteria in which accounts are to be assigned to territories. And whenever an 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 as automatic assignment.
The other option, manual assignment, as the name says it is manually assigning an account to territory. So now let’s see what is this automatic assignment? Go to the salesforce developer. org, navigate to our territory model view hierarchy. So here we see our hierarchy. In this we have the parent territories and also the child territories.
Now, depending upon in which territory we are going to create these account assignment rules, go to that particular territory and create it. Say for example, I’m going to create some account assignment rules for UK for this particular territory. So go to the territory and here you would see all the details, you also see the access levels and here you see related list. In that related list you would see a related list called as assignment rules assigned to this territory. So as such, we see there are no assignment rules defined. Click on new.
Let’s create a new assignment rule. And this territory is UK. So the assignment rule that we are going to create is assign all accounts with country as UK to this particular territory. All right, this is just a sample criteria that I have taken. So fill in the details. Here I have given the rule name, unique name and also the criteria is defined. We have said that if the accounts building country, if that field equals UK, then automatically assign that account to this territory UK. And the next option is if it applies to child territories. Also in our scenario it is not applicable.
UK does not have any child territories. So let me not check this checkbox. And the final option is to set it as active. So once you are done with all the details, activate the rule. So now we have successfully created our first assignment rule for this territory. However, creating this rule will not actually make any assignments happen. Basically, we have to run these rules for assigning the accounts to the territories. So let’s go back to the territory hierarchy.
And here we are with the UK territory. We have created rules and here you have the run rules option for running the rules that we created. But before that, what I’m going to do is I’m going to test if the account assignment has got happened. Now what we are going to do is in accounts, I have already done the data setup, I picked a couple of accounts and updated the billing country to UK. So thereby when we run the rules, we’ll be able to test it. Say for example, this particular account, the country is updated to UK. So once the enterprise territory management is enabled, what happens is in accounts we’ll have a couple more related list. So let’s add those related list out here. The related list are assigned territories
and users in assigned territories. So add these related list to the layout so we’ll be able to test our changes. Now we have added those related list here. As you can see, there are no territories assigned to this account. So now what I’m going to do is I’m going to run rules and we are going to test the same. We are here in the UK territory run rules. So it says assignment rules are currently running. You will be notified via email once the rules are finished. Perfect. So we’ll also get an email notification when the rules are done. And now, yeah, the rules are done. So let’s go and check the email. This is the email I got from salesforce saying that the assignment rules have run successfully. Now let’s go back to the same account and see if the territories are assigned. Awesome. So you see that? So now this account falls in this particular territory, what is the territory UK and in which territory model? This is the territory model and the model state is planning.
So this is also very important to note now that our territory model is in the planning state. So whenever we are defining all these, whenever we are creating this territory model, creating territories, it is very important that we create these rules and run these rules and see a preview of all the accounts and users that are assigned to a particular territory. So thereby we’ll be sure that the proper accounts and proper users are assigned to the territories. So once we are completely done with the setup, once we are completely satisfied with the data and how the rules work, only then we have to go and activate our territory model. And when we activate our territory model, only then actual assignment of all the accounts happens to the territory.
So this is very important that we see a preview of the data before we actually activate our territory model. Awesome. So now that we know our rules are working, the one that we created for UK, so this is called as automatic assignment of accounts. So this happens by creating rules which automatically the rules run when account gets created or edited in the system. The next method is manual assignment. Manual assignment, as we know as the name says, it is manually assigning accounts to territories. So let’s go to the same territory, UK. And here you see another related list which says manually assigned accounts. So it is as simple as that. Hit the button, it shows all the accounts choose which all the accounts that we want to assign manually to that particular territory and then click Save. So here, let me maybe pick a couple of accounts, assign them to this particular territory. So this is how we manually assign accounts to territories.
So in this case UK. So if you go, you see these are the accounts that are manually assigned to this territory. And there is also Assignment rule that is assigned here. So this is a way how you manually assign one or more accounts to a particular territory. There is another way of doing that, that is manually assigning an account to one or more territories. So that is another way. So for that, go to that account and here you have the assigned territories. Click on Assign Territories, select the Territory model, select in which are all the territories you want to assign that account, and then click Assign.
So this is another way of doing that. So this is how we assign accounts to territories, either by automatic assignment, by creating rules, or by manual assignment. You can assign a single account to multiple territories, or you can assign multiple accounts to a single territory. And the most important thing is to have a preview of the data before we actually activate the territory model it’s.
- Assigning Users to Territories
Now that we have understood how to assign accounts to territories, now let’s understand how do we assign users to territories? Because we know territory is a group of accounts and users. So adding users is inevitable because only the users will have access to the accounts to sell their products and services. So we are almost here. We are done assigning accounts to territories we know. How do we create rules and how do we activate them? How do we make it work? Now let’s understand about assigning users to territories. So let’s go back to our territory model.
Pick any territory wherein you want to assign users. Let me pick the same territory that is UK. Navigate to the territory and you see a related list that says Assigned Users. Click on Manage Users and assign all the appropriate users to the particular territory. So this is how we assign users to territories. So in our scenario, let me just add one user. So if you navigate to the territory, you will be able to see which are all the users that are assigned to this territory? What are all the rules that are assigned here, what are all the manually assigned accounts that we have here, and all the details?
- Colloborate with Territory Models using Chatter
This is a pretty simple concept how do we collaborate with territory models using chatter? In the basic admin course itself we understood about chatter and how do we use chatter to collaborate with the other objects and users, right? Similarly, Salesforce allows us to enable chatter on the territory model object so that we can collaborate directly within the model records so we and our team, we can collaborate and we can also get notifications whenever there are changes.
Happening in the territory model. So that is basically called as collaborating with the territory models using chatter. In fact, enabling this feature in salesforce is pretty much the same how we do for the other objects in the salesforce. org. Go for chatter feed tracking and then look for the territory management. Sorry, territory model object. So here, if we want to enable feed tracking, enable the feed tracking and also enable which are all the fields that you want to track. Say, for example, activated date and also the state safe. Perfect. So now we have enabled feet tracking for the territory model object this way we can collaborate and get notifications whenever changes happen to the territory model.
- Activating Territory Model
Now that we are done with the setup and once we do a preview and after testing, when we are completely satisfied with the territory hierarchy that we have created, the rules that we have created and preview of the data based on the rules. Once all the data set up, the configuration setup is done. Testing completed. Then the final step is to activate our territory model. So we are almost done and we are here activating our territory model. Perfect. This is the time that we are waiting for. So here go to a salesforce. org and this is the territory model that we have, ABC Global Sales.
Now let’s activate it. Yes, activate this territory model. Yes. So it says like activating applies the territory model to your organization. Users in the model’s territories are granted access and other objects based on the assignment rules and manual assignments. So only after we activated actually assignment of the accounts and the users happens is in progress and it may take several hours depending on the data. And once it is done, we’ll get an email notification. Awesome.
So now that this activation is done, we can see that the territory model state is active on top of it. We also see the feed tracking results here, right? We just enabled feed tracking. We also see that here because I think we enabled for the state field and also for the date field. So we are seeing these results out here. Now that it is enabled automatically, the user will get access to the account records and also the related records based on the access levels that we have set up.
- Running Opportunity Territory Assignment Filter
The final topic in the segment is about how do we run the opportunity territory assignment filter. So now that we have pretty much traveled a long way in understanding about the concepts, and finally, we are now here activating the territory model. So we have one model in our system which is activated. Now, let’s also do a quick understanding of what is this opportunity territory assignment filter while creating territories and after that, basically we created rules and we also in fact manually did assigning accounts to territories, right?
So similarly, we can also assign opportunities to territories. But the method is a little different. For assigning accounts, we had some rules based on which the accounts are getting assigned to territories. However, for opportunities, it is basically Apex Class. And logic is written in that Apex class which will help us assign the opportunities to territories. So when we want to enable that feature, enable that feature and also give the Apex class name. Salesforce has already helped us with that Apex Class. You can have a look at it. It is in the developer Salesforce. com site. So based on this logic, opportunity will get assigned to territory. So once you give this Apex class here, then we can also check this checkbox which says run filter based opportunity territory assignment jobs when opportunities are created. So if you want the scenario as well, then check this checkbox. So once this is done in opportunities, basically you will have two more fields.
One is a territory field, the other is the exclude this opportunity from assignments. So the significance of these two fields, one is a territory field. So as simple as that, it will tell you to which territory that opportunity is assigned. The second field is called Exclude from the territory assignment filter logic. This field is actually a checkbox. So when that checkbox is checked, that opportunity will not be evaluated using the filter logic. So that opportunity will not be a part of a territory. So when a checkbox is unchecked, then that territory then that opportunity will be included in the territory assignment filter logic and that will be mapped accordingly. So this is the whole concept of territory management.