ads

Wednesday, 29 August 2018

Find number of pending batch jobs in Salesforce

Code Format:


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