Loading

Error 'INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY' When Apex Reassigns an Approval Process in Salesforce

Data pubblicazione: May 19, 2026
Descrizione

When attempting to reassign an approval step by updating the ActorId field on the ProcessInstanceWorkitem object via Apex, you may receive the error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY insufficient access rights on cross-reference id. This error indicates that the user being assigned as the new Actor does not have the required sharing access to the record. OWD (Organization-Wide Default) sharing settings and the role hierarchy are typically the root cause.
ActorId is the ID of the user who is currently responsible for approving an approval request on a ProcessInstanceWorkitem record.

Risoluzione

Root Cause Analysis

For a user to be assigned as the Actor on an approval step, they must have sharing access to the record being approved. If sharing access is insufficient, you receive the INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY error.
OWD (Organization-Wide Default) is the baseline level of record access configured for all users in your org. When OWD is set to Private or Public Read Only, sharing must be explicitly granted.

Scenario 1: OWD and Sharing Restrictions

If your OWD is set to Private or Public Read Only:

  1. Check the sharing settings for the current Owner's Role on the record.
  2. Confirm whether the target Actor (the user you want to assign) has sharing access to that record via their role.
  3. If the target user does not have access, you cannot assign them as the Actor and the error will be thrown.
  4. To resolve: grant the user sharing access to the record (via manual sharing, a sharing rule, or a role hierarchy update) before attempting to update the ActorId.

Scenario 2: Wrong User Context

If you are trying to reassign an approval step owned by User2 while logged in as User1:

  1. User2 is the current owner of the approval step (ActorId is set to User2's ID).
  2. To reassign the step, you must execute the Apex code in the context of User2 (i.e., log in as User2 or use System.runAs(User2)).
  3. Attempting to reassign as User1 will result in the INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY error.

Resolution Steps

  1. Identify which scenario applies (OWD restriction or wrong user context).
  2. Grant the necessary sharing access to the target user, or execute the reassignment in the correct user context.
  3. After resolving access, retry the ActorId update via Apex.
Risorse aggiuntive
Numero articolo Knowledge

000387357

 
Caricamento
Salesforce Help | Article