Future count with Apex Code

Posted by Andrea on 2011-07-14 11:06

Please note: supports up to 50000 future calls in a 24h timespan

public with sharing class AsyncApexJobUtils {
	public static integer futureCount() {
		integer c = [select count() from AsyncApexJob where JobType='Future' and CreatedDate >= :Datetime.now().addDays(-1) limit 50000];
		system.debug('#futureCount: ' + c);
		return c;
	}
}