February 9, 2021

How to abort Apex Jobs using Apex in Salesforce?

Use System.abortJob( '<JobID>' ) to abort the job.
 
To get the JobId, use the "AsyncApexJob" object. Add proper WHERE condition to the SOQL to find the Job Ids.
 

No comments:

Post a Comment