Rebalancing complex territory structures

By | June 18, 2014

When it comes to Territories, implementation complexity increases. When it comes to migration of territories and rebalancing the territory structure, it becomes more complex. I have already discussed on this blog how you can swiftly carry our Territory migration. See below link.
Related Post: Territory Migration
Now I will discuss how to handle rebalancing of complex territory structure. Here by I am sharing my experience with you where we came across a complex and unmanaged territory structure where 1400+ territories were created in Sage CRM and never gone under Territory Rebalancing activity. Customer came up reporting that they are not able to create, move or merge territories anymore, hence our first step was to run Territory Rebalancing but it started giving errors in the process.
Going by the Sage CRM guide books; it is clearly mentioned that “Merging and Moving a territory requires rebalancing of the Territory tree structure” also there are instructions that the standard capacity for a territory structure is 16 “child territories” on each territory, and five territory levels deep. A complex territory structure may require the expansion of the standard capacity.
Since it was not able to rebalance the territory structure hence we started troubleshooting through log files and after some deep excavation and series of troubleshooting we came up with steps which helped us resolving this issue, I hope it will help/give some direction to you in case you are facing similar issues:
Step1.   Backup Sage CRM Database.
Step2.   Check! No record should be lying without territory in any entity involved in merging/moving activity. If you find any record with null value, update it with worldwide or respective territory value.
Step3.   Restart both DB and Application server.
Step4.   Disable all triggers before merging. (In our case there were various triggers created on different entities).
Step5.   Stop CRM services and lock the system before rebalancing the territories.
Step6.   Run territory rebalancing.
Step7.   Unlock CRM and Refresh metadata.
Step8.   Restart both servers.
Step9.   Stop CRM services and lock the system before moving/merging the territories.
Step10. Now we were able to Merge Territories without any error.
Step11. Enable all triggers, Reset IIS and Run CRM services.
Note* Do not logout CRM admin account while CRM is locked; unlock CRM before logging out from CRM.
Also Read:
1) Re-assignment within same team/territory
2) User’s Home Territory and Assigned to rights in CRM
3) Setting a Territory field by default to Worldwide
4) Mass Update and Territory Update In Sage CRM
5) Territory Profiles Issue in CRM