Activity Forums Salesforce® Discussions How to reassign an approval request through Apex?

  • Anuj

    Member
    May 15, 2020 at 2:24 pm

    To change the responsible for an approval request you have to update the ActorId field on the ProcessInstanceWorkItem object with the Id of the user you want to be the actual approver.
    e.g
    ProcessInstanceWorkItem pi = [SELECT Id, ActorId FROM ProcessInstanceWorkItem LIMIT 1];
    pi.ActorId = '0051I0000027LCVQA2';
    update pi;

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos