Skip to content

Cancelling Queued Rollups

James Simone edited this page Sep 30, 2021 · 3 revisions

This question originally came up in a discussion, but it's a useful tidbit if there are ever any "stuck" Rollup jobs. You can run the following in Anonymous Apex to get rid of these:

List<AsyncApexJob> queuedJobs = [
  SELECT Id
  FROM AsyncApexJob
  WHERE Status = 'Queued'
  AND ApexClass.Name = 'RollupAsyncProcessor'
  LIMIT 30
];
for (AsyncApexJob job : queuedJobs) {
  try {
      System.abortJob(job.Id);
  } catch (Exception e) { }
}