Abort all the queued APEX jobs

To view if there are any queued jobs on Salesforce, click Setup > Administration Setup > Monitoring > Apex Jobs

Run the below mentioned script on Salesforce, do as follows:

Click Developer Console on Salesforce, under Debug, select Open Execute Anonymous Window and paste the above query on the Apex Code box.

 
AsyncApexJob[] activeJobs = [select id from AsyncApexJob where Status = 'Queued' ];

 for(Integer count=0; count<activeJobs.size(); count++ )
{
  try
  {
   System.abortJob(activeJobs[count].id);
  }
  catch( Exception myException )
  {
  System.debug(myException);
  }
 }


Click Execute. Now all the queued job will get aborted.

Comments

Popular Posts