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
Sapn ThakurSapn Thakur 

Need help in approval process

Hi All,

 

If cases are pending for approval from certain time of period we want to send the email to the Approvers using "Batch Apex" and "Apex scheduler". How can we get the approver information (like email id) in Batch Apex?

 

Please let me know.

 

-Sapna

SabrentSabrent

Is there a particular reason you want to use Batch Apex?I had a similar requirement and after considering Batch Apex, I was pointed by a board member to the report called "All Pending Approval Requests" in the Administrative Reports folder which I cloned and used for this purpose. Hope this helps.

Sapn ThakurSapn Thakur

Hey, thanks for your reply.

 

What I wanted to do is if cases are pending from say 2 days then I want to send the reminder email to the Approver.

 

I was thinking of using "Batch Apex" and "Apex scheduler" to create schedule job, which will execute on daily basis and it will check that if case status and then send mail. 

 

Please let me know is there any other way to achieve this. Thanks!

 

-Sapna

SabrentSabrent

Hello Sapn, have you tried Email Alert on Time-Dependent Workflow Actions? 

Sapn ThakurSapn Thakur

Hi Rov, I have tried with Time-Dependent Workflow rules also but that is not working.

SabrentSabrent

I tried something similar based on an example in the cookbook, let me edit it to hide my data and send it to you.