Print this page

Getting INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY while reassigning Approval Process via Apex

Knowledge Article Number 000206576
Description You are trying to update current approver via Apex and you are getting INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY insufficient access rights on cross-reference id: [] .

We have ActorId field which is ID of the user who is currently responsible for approving an approval request and this can be updated via Apex.However while doing the same we are getting the below error :-

INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY insufficient access rights on cross-reference id: [] .

 

Resolution As per salesforce doc for ProcessInstanceWorkitem objects :-
https://www.salesforce.com/developer/docs/api/Content/sforce_api_objects_processinstanceworkitem.htm

ActorId : ID of the user who is currently responsible for approving an approval request.

To reassign the approval step,we need to update the ActorId via Apex,however while updating the same,we see INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY  insufficient access rights on cross-reference id: [] .Below are some of the reasons for the same :-
  1. In order to be the "Actor" the user would need to have sharing access to the record that you are assign him/her to as the actor.
    1. Check your OWD and if it is Private / Public Read, then check the Sharing settings for the current Owner Role of the record and see if it is shared with the "actorid" user role.
    2. If the answer is no, then you cannot assign them as the actor and you will hit this error.
  2. OR
    1. You were trying to change an approval process by User1, while User2 is the current approver.
    2. As User2 is the owner of the approval step,you need to login as User2 and then you can reassign it via Apex.
    3. If you try to reassign it by logging as User1 ,you will hit this error.




promote demote