List<String> JobStatus = new List<String> {'Holding', 'Queued', 'Preparing', 'Processing'}; List<AsyncApexJob> pendingJobsStatus = [SELECT Id FROM AsyncApexJob WHERE Status IN: JobStatus];
pendingJobsStatus.size() ;// Note : This will give you the number of pending batch jobs in Salesforce
No comments:
Post a Comment