function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SaravanaBharathi-SBSaravanaBharathi-SB 

Reg:system.queryexception Non-Selective query with large object type

Have trigger to check duplicate with certain parameters

 

 

Query is:

 

(Select id from x__c where (((a__c = request.a__c) and (b__c =request.b__c) and (c__c = request.c__c) and (lastmodifieddate>=system.today) limit 1);

 

X__c is the object having 1,75,000 records. For satisfying this condition, its having only 5 records,

 

The same query, ran in the developer console,controller its running successfully.

 

When i run this query in the trigger, its throwing error.

 

Could any one help on this? Please..:(

 

 

SaravanaBharathi-SBSaravanaBharathi-SB

Thanks for you reply,

 

But we dont have any external Id for the filtered fields.. Then how to resolve this.

TejTej

you can turn it on at the field level, but if it's in prod you need to work with salesforce support.

dphilldphill
It might help us if you let us know what the error is too.