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
vijaya kudupudivijaya kudupudi 

how to set second level approver for a record using apex coding in approval process

Hi all,

I have created the dynamic approval process on a custom object. In this i can able to send send one approval request. If i am trying to set one more approver id to req.setNextApproverIds(new Id[] {apl[1].approver__c}) method, I am getting exception. How can i send request to the second approver ? Please any body can help me.
Srinivas SSrinivas S
Hi Vijaya,

In step-1 if the approver approves if you are making any field update based on the you can again fire the apex logic to set the 2nd approver.
- Please mark as solution if your problem is resolved.
vijaya kudupudivijaya kudupudi
Hi Srinivasa Reddy,

Thank you for response. I didn't give any field updates in this approval process I am just sending approval request based on the condition which is given in apex trigger. Then how can i send second level approvel request based on the first level response ?

And, i have created a dummy approval process for this and I have created only one step in that approval process. To send second level approval request. Have i need to create second step in the dummy approval process?