Update the Approver from Developer Console #inSalesforce

Update the Approver from Developer Console #inSalesforce


For updating the Approver for an Approval request you have to update the ActorId field on the ProcessInstanceWorkItem object with the Id of the user you want to reassign.


ProcessInstanceWorkItem piwi = [SELECT Id, ActorId FROM ProcessInstanceWorkItem WHERE Id = 'YOUR SUBMITTED APPROVAL PROCESS ID'];
piwi.ActorId = 'Place the User ID for Re-Assignment';
update piwi;

Comments