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
vamsi krishna 106vamsi krishna 106 

No applicable approval process was found

Hey guys,
I am getting this error "​No applicable approval process was found"
Here my code

​Approval.ProcessSubmitRequest req1 = new Approval.ProcessSubmitRequest();
        req1.setComments('Submitting request for approval.');
        req1.setObjectId(consignment.id);
        req1.setProcessDefinitionNameOrId('PTO_Request_Process');
        req1.setSkipEntryCriteria(true);
        system.debug('new approve'+req1);
        Approval.ProcessResult result = Approval.process(req1);
please help me guys..

Thanks
Vamsikrishna​

Antonio Luzio 5Antonio Luzio 5
Hi Vamsi.
 
The information that you are showing is not enough to understand the problem. To understand the problem you also need to post the approval process for the object. From the information that I see, I think that you are sending the record to approve but there is no rule in the approval that meets any approval criteria.
Please se the link below:
http://salesforce.stackexchange.com/questions/112432/error-while-running-a-test-class-no-applicable-process-no-applicable-approval-p 
Is a similar problem.

I hope that this information help you.

Best Regards
António Luzio
 
Arnav Ray 1Arnav Ray 1
Please create a approval process for that particular object using the standard approval process....