Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Delete all schedule jobs in an org.
List<CronTrigger> listCronTrigger = [select Id, CronExpression, EndTime, NextFireTime, OwnerId,
PreviousFireTime, StartTime, State, TimesTriggered, TimeZoneSidKey from CronTrigger
where State = 'Waiting' or State='Running'];
System.debug('No of jobs: '+listCronTrigger.size());
If (listCronTrigger.size() > 0)
for (Integer i = 0; i < listCronTrigger.size(); i++)
System.debug('Job details ::'+String.valueOf(listCronTrigger[i]));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.