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
Rick RossiRick Rossi 

Duplicate Trigger

Hello,

I currently cannot use the out of the box duplicate/matcing rules for the contact object due to the amount of duplicates. How would a trigger look like to allow duplicates but notifity the users that a duplicates exist? The criteria is exact Account ID, email, and fuzzy first and last name.

Thanx!
Rick RossiRick Rossi
Hi !

Thanks for getting back to me. I got the following error message when testing:

PreventDuplicateContacts: execution of BeforeInsert 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.PreventDuplicateContacts: line 14, column 1

Would this be due to the amount of records?
RAHUL KRISHNA 8RAHUL KRISHNA 8
Thanks for the above information Mr. rick. Its so usefull to me

Regards 
Rahul Krishna
https://www.adept-sol.com/