Loading

Error 'Insufficient Access Rights On Object Id' on delete of AccountShare for assigned Territory

Publiceringsdatum: Mar 12, 2026
Beskrivning

Attempting to delete an AccountShare record with RowCause: Territory2AssociationManual or Territory via the API results in:
 

Insufficient Access Rights On Object Id

Status: INSUFFICIENT_ACCESS_OR_READONLY

 
Lösning


This error is expected and by design because these types of AccountShare records are automatically created and maintained by the system when a Territory is assigned to the Account.

The correct approach to remove an AccountShare established via Enterprise Territory Management assignment is to remove the Territory that's assigned to the Account which in turn, automatically removes or deletes the corresponding AccountShare.


If the AccountShare RowCause is "Territory" or the Account's "Assigned Territories" related list displays "Territory Assignment Rule" for the Method column, this means the Territory was automatically assigned to the Account via a Territory Assignment Rule. Attempting to directly delete the related ObjectTerritory2Association record or clicking the "Unassign" action in the related list will result in the following message:

 

An Object Territory Association Cannot Be Created Or Deleted With Territory Assignment Rule Association Cause.

Status: INVALID_OPERATION



Options to remove a Territory automatically assigned to an Account via assignment rules:


Decide which of the following actions is most ideal for your unique requirements and then click the "Run Rules" button in the "Assignment Rules Defined in This Territory" related list on the Territory's detail page in setup to re-evaluate the assignment rule and remove desired Accounts from a Territory:
 
 
  • Edit the Account record to no longer meet the assignment rule's criteria.

Note: If your org is configured to Run territory assignment rules when you edit an Account users can check the "Evaluate this account against territory rules on save" checkbox after editing the Account to no longer meet the assignment rule criteria as an alternative to using the "Run Rules" button on the Territory's detail page in setup.
 
   
  • Deselect the Active checkbox to deactivate the Assignment Rule. See Create Rules to Assign Accounts to Territories for more details. Keep in mind, making the rule active again without addressing the underlying data or rule itself will simply result in the Account being re-assigned to the Territory the next time the rule is evaluated.
 
  • Click the Remove action in the "Assignment Rules Assigned to This Territory" related list on the Territory Detail page in setup to disassociate the assignment rule from the Territory.
 


Options to remove an Account's manually assigned Territory:


1. The Remove action available on the Territory setup or detail page's Manually Assigned Accounts related list. See Assign Accounts and Leads to Territories Manually for more details.


2. Use the Unassign action available in the Account detail page's Assigned Territories related list. See Configure Territory Permissions and Access for Salesforce Admins and Users for more details.


3. Use the API to Export Data or Query for desired ObjectTerritory2Association records and then delete them.
 

Query Example: SELECT Id, ObjectId FROM ObjectTerritory2Association WHERE ObjectId = '<AccountIdHere>'

Where <AccountIdHere> is the desired Account record Id for which you would like to remove territories.


Use the returned ObjectTerritory2Association record Id (with key prefix 0JB) to perform a delete to effectively remove the manual territory assignment from the Account. See Insert, Update, or Delete Data Using Data Loader for more details.


4. If the Territory assigned to the account is no longer needed, an Admin may choose to Delete a Territory Model which will also inherently remove the Territory from any assigned accounts.
Knowledge-artikelnummer

000380273

 
Laddar
Salesforce Help | Article