You need to sign in to do that
Don't have an account?

Approval Process Approval Question
Good Morning All!
In my organization, we have created an Approval Process on a custom object (Job) which gets automatically submited to a specific role (GM) 50 days after "Contract Date." The business has now requested that after 3 days, if the GM has not approved or declined the request, that it is automatically marked as approved.
Is there anyway to create an Apex Class or trigger with these requirements? I was thinking to add a step to my Process Builder with that criteria to fire an Apex Class if the GM Approved and GM Declined date are both blank after 3 days of the approval process start date but not sure how to approve via that Apex Class. I've found a lot of posts about submitting and then approving a request but having trouble locating anything about approving a pending request.
Thanks for any help!
In my organization, we have created an Approval Process on a custom object (Job) which gets automatically submited to a specific role (GM) 50 days after "Contract Date." The business has now requested that after 3 days, if the GM has not approved or declined the request, that it is automatically marked as approved.
Is there anyway to create an Apex Class or trigger with these requirements? I was thinking to add a step to my Process Builder with that criteria to fire an Apex Class if the GM Approved and GM Declined date are both blank after 3 days of the approval process start date but not sure how to approve via that Apex Class. I've found a lot of posts about submitting and then approving a request but having trouble locating anything about approving a pending request.
Thanks for any help!
You have to write a batch class. I have posted sample code here and update query according to your need.
You can execute a batch or schedule it accordingly.