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
sridhar k 9sridhar k 9 

Two Approval process on same object

Hi All,
Is it possible to create two approval process on same object through trigger?If yes please give me a sample code for refernce

Regards,
Sridhar 
Siddharth83JainSiddharth83Jain
Hi Sridhar,

There shouldn't be any issues with, below is a sample to call Approval process from Apex

//Approval process Initiated
            Approval.ProcessSubmitRequest objApprovalRequest= new Approval.ProcessSubmitRequest();
            objApprovalRequest.setComments('Submitted for approval. Please approve.');
            objApprovalRequest.setObjectId(objEmailCase.id);
            System.debug('##approvalRequest'+objApprovalRequest);
            Approval.ProcessResult resultProcess = Approval.process(objApprovalRequest);
            System.debug('##Submitted for approval successfully: '+resultProcess.isSuccess());

Let me know if you have any questions.

If this help the please mark this as a best answer

Thanks
Siddharth
OSI Consulting.
Fabio PalladinoFabio Palladino
Hi Sridhar,
I think it's not possible to have two different approval process fired for the same object at the same time.
You can create one Approval process with different approval step inside.
Let me know.

Regards