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
Adarsh Bhat GAdarsh Bhat G 

Approval process from Apex

Hi,

I have a approval process on opportunity which should be automatically submitted whenever a custom field value is changed to a specific value . It should be routed to approvals for all opportunity team members. This currently not possible with out of the box features.

Hence I have currently selected Let the submitter choose the approver manually option while configuring the approval process and calling the approval process by trigger. But currently it is working with  UNANIMOUS approval from all approvers. But I want Approve or reject based on the FIRST response. Any idea on how we can achieve this?

Note: In approval process configuration, since I have selected Let the submitter choose the approver manually, I won't be able to set the approval behavior there.

Regards,
Adarsh

 
VinayVinay (Salesforce Developers) 
Hi Adarsh,

Check below examples to build dynamic approval process in Salesforce using apex.

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_process_example.htm
https://www.jitendrazaa.com/blog/salesforce/dynamic-approval-process-based-on-the-apex-and-trigger/

Please mark as Best Answer if above information was helpful.

Thanks,