You need to sign in to do that
Don't have an account?
StandardSetController problem ,help me
I am getting this error for below StandardSetController code
14:28:20.105 (105857000)|EXCEPTION_THROWN|[13]|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)
//////-----------------------------------------------------------------------------------------
public class duplicateSMSFinder{
public static string processNo;
public ApexPages.StandardSetController setCon {
get {
if(setCon == null && processNo !=null)
{
try{
system.debug(processNo+'ddddddddd');
setCon = new ApexPages.StandardSetController(Database.getQueryLocator([SELECT id,
Email,
Customer_Mobile__c,
Mobile_Number__c from
lead where
Customer_Mobile__c=:processNo limit 1]));
}catch(exception e){}
}//if
return setCon;
}
set;
}//construcor
// Initialize setCon and return a list of records
public List<lead> getleadLists(string pSMSNO) {
processNo=pSMSNO;
if(setCon != null){
return (List<lead>)setCon.getRecords();
}
else{return null;}
}
} //end of class
//////-----------------------------------------------------------------------------------------
Hi,
Try to limit the result set that needs to be evaluated by adding " Customer_Mobile__c <> NULL" to the query WHERE string.
I didn't try it though, but it might help.
Or you can use SOSL instead of SOQL.
Let me know if it works.
Regards,
Hengky
Thanks
I have used SOSL