NO_APPLICABLE_PROCESS :No applicable process found!

Is there a chance you created the approval process but don't have it activated? Does your account meet the entry criteria for your approval process? This error is thrown when an object is attempted to be submitted for approval and no approval process can be found, either because it isn't activated or your object doesn't meet the entry criteria.

You can not just instantiate this code. There must already be an approval process in the system for you to be able to run this code.


I think there is a problem with profile permissions. Try with this code:

Account acc1 = new Account(Name='acc1');
        insert acc1

        if([select count() from ProcessInstance where targetobjectid=:acc1.id] < 1)
        {       
            Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest();
            req.setComments('Approve.');
            req.setNextApproverIds(new Id[] {UserInfo.getUserId()});
            req.setObjectId(acc1.Id);

            //Submit the approval request
            Approval.ProcessResult result = Approval.process(req);

        }