Loading

Salesforce Enterprise Territory Management: Insufficient Access Rights Error When Deleting AccountShare Records with Data Loader

Udgivelsesdato: Oct 14, 2026
Beskrivelse

In Salesforce Enterprise Territory Management, deleting an AccountShare record with a RowCause of Territory2AssociationManual or Territory through Data Loader or the API returns the following error:

Insufficient Access Rights On Object Id. Status: INSUFFICIENT_ACCESS_OR_READONLY

Løsning

This article explains why Salesforce returns an Insufficient Access error when you delete a territory-based AccountShare record, and how to remove the share by removing the territory assignment from the account.

Why This Error Happens

This error is expected and by design. The system automatically creates and maintains these AccountShare records when a territory is assigned to the account. To remove an AccountShare established through Enterprise Territory Management, remove the territory that is assigned to the account. Salesforce then automatically deletes the corresponding AccountShare record.

Identify How the Territory Was Assigned

If the AccountShare RowCause is "Territory", or the "Assigned Territories" related list on the account shows "Territory Assignment Rule" in the Method column, a territory assignment rule assigned the territory automatically. Deleting the related ObjectTerritory2Association record directly, or clicking the "Unassign" action in the related list, returns this message:

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

Remove a Territory Assigned by an Assignment Rule

Decide which of the following actions best fits your requirements. Then click the "Run Rules" button in the "Assignment Rules Defined in This Territory" related list on the territory detail page in Setup to re-evaluate the assignment rule and remove the accounts from the territory.

  • Edit the account record so it no longer meets the assignment rule criteria. If your org is configured to run territory assignment rules when you edit an account, you can instead select the "Evaluate this account against territory rules on save" checkbox after editing the account.
  • Edit the assignment rule to exclude the account. See Setting Up and Managing Territory Assignments.
  • Deselect the Active checkbox to deactivate the assignment rule. Making the rule active again without addressing the underlying data or the rule itself causes Salesforce to reassign the account to the territory the next time it evaluates the rule.
  • 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.

Remove a Manually Assigned Territory

Use one of the following options to remove an account's manually assigned territory.

  1. Use the Remove action in the "Manually Assigned Accounts" related list on the territory detail page in Setup.
  2. Use the Unassign action in the "Assigned Territories" related list on the account detail page.
  3. Use the API to query the ObjectTerritory2Association records for the account, and then delete them with Data Loader.
  4. If the territory assigned to the account is no longer needed, an admin can delete the territory model, which also removes the territory from all assigned accounts.

Delete ObjectTerritory2Association Records with Data Loader

Run the following query to find the ObjectTerritory2Association records for an account. Replace AccountIdHere with the record Id of the account whose territories you want to remove.

SELECT Id, ObjectId FROM ObjectTerritory2Association WHERE ObjectId = 'AccountIdHere'

Use the returned ObjectTerritory2Association record Id, which has the key prefix 0JB, to perform a delete. This removes the manual territory assignment from the account. See Insert, Update, or Delete Data Using Data Loader for more details.

Vidensartikelnummer

000380273

 
Indlæser
Salesforce Help | Article