How to See All Batch Apex Classes in a Salesforce Org?

Running this code in the Developer Console anonymous window will give you the list of all batch apex classes in your Salesforce org.


list<ApexClass> lstApexClasses = [SELECT Id, Name, ApiVersion, Body FROM ApexClass where NamespacePrefix = null];

for(ApexClass iterator : lstApexClasses) {

    if(iterator.Body.contains('Database.Batchable')) {

        system.debug('Batch Class Name ====> '+iterator.Name+' Api Version ====> '+iterator.ApiVersion);

    }

}





After executing the code, open the log and the result will be like






Comments

Popular posts from this blog

Best Practices For Writing a Trigger in Salesforce org