You need to sign in to do that
Don't have an account?
code developer
How to change the actual approver in approval process using apex?
Hi,
We are approving a record using apex.
We are updating the actor id in Process InstanceWorkitem object with desired approver.
But, the record is not getting approved with actual approver.
Can we change the actual approver of the record?
We are approving a record using apex.
We are updating the actor id in Process InstanceWorkitem object with desired approver.
But, the record is not getting approved with actual approver.
Can we change the actual approver of the record?
I have logged in as user 'C' and have executed this code :
ProcessInstanceWorkitem p = [Select p.SystemModstamp, p.ProcessInstanceId, p.OriginalActorId, p.IsDeleted, p.Id, p.CreatedDate, p.CreatedById, p.Actor.Email, p.ActorId From ProcessInstanceWorkitem p where id='04i17000000Cay7'];
p.actorid= '00517000000HfZm'; // user id of user B
update p;
Approval.ProcessWorkitemRequest req = new Approval.ProcessWorkitemRequest();
req.setAction('Approve');
req.setWorkitemId(p.id);
Approval.ProcessResult actResult = Approval.process(req);
But when i see the record the actual approver is user C even though I have mentioned actor as user B.
Have you got any solution for above issue?