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

Approving records that are pending from last two days through apex schedulable interface
I have to take any standard or custom object. Apply approval process on it and approve the pending records which are pending from last two days through an apex schedulable class that should run once after every 24 hours.
For which i have to write a code.
Please help.
For which i have to write a code.
Please help.
Hi Nikhil,
Please folow the steps as mentioned below:
1. Craete an apex batch class. You can take help from this link: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_batch_interface.htm
2. Add the logic in this batch class to approve pending records. You can take help from this link: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_process_example.htm
3. Write a scheduler class for your batch class as created in #1. You can take help from this link: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_scheduler.htm
4. Generate a Crone Expression for your scheduler class and then schedule it from developer console.You can take help from this link: http://www.cronmaker.com
Please let me know if you need any further information or help on this.
Thanks,
Abhishek Bansal.