function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
VishalAscVishalAsc 

Approval from trigger - final actions to executed

Hi All,

Thanks for looking at this issue.

 

I am approving opportunities from a trigger as:

 

Approval.ProcessWorkitemRequest req = new Approval.ProcessWorkitemRequest();
req.setComments('Approving request using Trigger');
req.setAction('Approve');
ProcessInstanceWorkitem workItem = [Select p.Id from ProcessInstanceWorkitem p where p.ProcessInstance.TargetObjectId =: opp.Id];
Id workItemId = workItem.Id;
req.setWorkitemId(workItemId);
Approval.ProcessResult result1 =  Approval.process(req);

 

I have some final approval actions set on opportunity approval process.

 

But these actions are not executed whe opportunities are approved from triger.

 

Any thoughts?

 

Thanks,

Bakul

c_r_carvalhoc_r_carvalho
I have same problem, do you resolve this issue?

tks,
c_r_carvalhoc_r_carvalho
In my case the problem was the VALUE in approval process actions.

When I did the deploy from snadbox to production, my language in sandbox was Portuguese and in production was English this caused a problem in the approval process.