Kill the scheduled job
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2017 03:33 AM
Hi All
We have a scheduled job running which has to delete records from task table. It needs to delete 400000 records. Its deleting only 20K per day.
Because of the scheduled job, instance has become slow.
We want to run the scheduled job during the non business hours.
Is it possible to kill the scheduled job automctically when we business hours starts. lets say it starts at 8 am, Can we kill the scheduled job automatically.
Manually we can but is it possible to automate that.
Thanks
Sonali
- Labels:
-
Best Practices
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2017 03:38 AM
Well, I do not understand why would someone want to delete records instead of either archiving it or making them active false.
I assume you must have already thought about this, which means you would want to deletion of records in chunks.
You can try using chooseWindow method as it would allow you to do batch based processing of records.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2017 03:49 AM
Hey Sonali,
Better if you setLimit(x no. of records), which obliviously you can figure out a range how much deletion is possible during the starting of business hours
post me your feedback
Please Hit ✅Correct, âÂ��Helpful, or ��Like depending on the impact of the response
Have a lovely day ahead
Regards,
Divya Mishra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2017 04:49 AM
Hi Kalai/Divya,
Yeah i can do that, but there isnt a way to automatically kill it in 12 hrs or so?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2017 05:19 AM
I think there are ways to do that using workflows but i don't think so via a scheduled job.