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
Chandu007Chandu007 

how to restrict user from creating duplicate records on custom object using Batch class & Trigger???

I want to restrict users from creating duplicate records on custom object using Batch class & Trigger??? since it's not working with Trigger(getting System.Query Exception)

Review all error messages below to correct your data.
Apex trigger ProjectDuplicateCheck caused an unexpected exception, contact your administrator: ProjectDuplicateCheck: execution of BeforeUpdate caused by: System.QueryException: Non-selective query against large object type (more than 200000 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): Trigger.ProjectDuplicateCheck: line 11, column 1

Please suggest if we have any AppExchange Apps to achieve this.


Thanks,
Chandra