You need to sign in to do that
Don't have an account?
lakshmi.sf9
Asynchjobs filters
Hi,
DateTime todayDate = system.today();
if ([SELECT count() FROM AsyncApexJob WHERE CreatedDate =:todayDate AND JobType='BatchApex' AND (Status = 'Processing' OR Status = 'Preparing')]<5)
getting error in this query as
caused by: System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or contact salesforce.com about custom indexing.
Even if a field is indexed a filter might still not be selective when:
1. The filter value includes null (for instance binding with a list that contains null)
2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times):
can any one please help on this.Its urgent
DateTime todayDate = system.today();
if ([SELECT count() FROM AsyncApexJob WHERE CreatedDate =:todayDate AND JobType='BatchApex' AND (Status = 'Processing' OR Status = 'Preparing')]<5)
getting error in this query as
caused by: System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or contact salesforce.com about custom indexing.
Even if a field is indexed a filter might still not be selective when:
1. The filter value includes null (for instance binding with a list that contains null)
2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times):
can any one please help on this.Its urgent
if ( [ SELECT count() FROM AsyncApexJob WHERE CreatedDate =:todayDate AND JobType='BatchApex' AND (Status = 'Processing' OR Status = 'Preparing') limit 10 ] < 5 )