function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rishi Kumar 65Rishi Kumar 65 

Manage Account Territory Association in Territory 1.0

Hi,

We are working on an appliction for both types of user (Territory management 1.0 or Enterprise Territory Management). Regarding Account Territory Association we have achieved the solution in Enterprise Territory Managment.

-> Reading through AccountShare and Group object
-> Writing thorugh ObjectTerritory2Association object.

But In Territory Management 1.0 there is no ObjectTerritory2Association object and we dont have permission for performing DML operation on AccountShare object. 
Can you please provide any alternative solution for managing Account Territory Association in Territory Managment 1.0

Thanks
Rishi
Daniel BallingerDaniel Ballinger
Looking at the ERD for both Territory Management 2.0 Objects (https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_erd_territory2.htm) and Territory Management (https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_erd_territory.htm) I don't think there is a direct equavalent to ObjectTerritory2Association (https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_objectterritory2association.htm) in Territory Management 1.0. AccountShare (https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_accountshare.htm) is more for a relationship between an Account and Group. It is only indirectly associated to the Territory via the Group to OpportunityShare to Opportunity to Territory relationships.

Have you looked at AccountTerritoryAssignmentRule (https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_accountterritoryassignmentrule.htm) and AccountTerritoryAssignmentRuleItem (https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_accountterritoryassignmentruleitem.htm)? Description from the first:

An account assignment rule that assigns accounts to territories based on account fields. Only available if territory management has been enabled for your organization.