You need to sign in to do that
Don't have an account?
Sai Bhaskar 16
Hi everyone I have got a scenario where I need to write a batch Apex to close all the pending opportunities of previous month, batch should schedule on every hour by using schedulable interface
Hi Everyone
I have got a scenario where I need to write a batch Apex to close all the pending opportunities of the previous month, the batch should schedule on every hour by using schedulable interface
Greetings to you!
Please try the below code, I have tested in my org and it is working fine. Kindly modify the code as per your requirement.
Batch Apex:
Now, We have the batch class ready and it has to be in a schedulable context in-order to schedule the batch
Scheduled Apex:
Finally, schedule the batch class by executing anonymous code from either developer console or apex, the minimum is 1 hour:
// Cron EXP for hourly schedule:
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas