Now salesforce provide effect way to Manage Duplicate Records in Salesforce without writing single line of code
Before Spring ‘16, to check for duplicate record in salesforce we have to write apex code in trigger, which will run on insert and updated of record and check if there is a duplicate record exist,
1) writing such code have lots of limitations like it won\’t allow to compare with more then 50000 as we can only query 50000 records
2) compering records will required loop which consume lot of CPU time,etc
So to help business and developers Starting in Spring ‘16, all new Salesforce orgs come with Duplicate Management features. After Duplicate Management is set up, this is how Duplicate Management works.
1) When a user attempts to save a new record, the record is first compared with existing Salesforce records to identify possible duplicates
2) When a user attempts to save an edited record, the record is first checked to see if the user has changed the value of a fields used in matching rule and if it dose system will run the rules and compared the record with existing Salesforcerecords
What will happen if system find a duplicate
So while setting up duplicate rules we can specific, that we want to block user from entering such record, or we can just give a warning message which will allow user to enter record
what will happen if user enter the duplicate record :- Salesforce will keep track of such records and provide us the ability to pull out an report on the such duplicate records.
Technical Advantages:- It help reducing code for duplicate triggers, it dose not have governor limits so it can compare the record to any numbers of existing records, Will help in improving the process time
Business Advantages :- Maintaining clean and accurate data is one of the most important things you can do to help your organization get the most out of Salesforce. Use Data.com Duplicate Management to control whether and when users can create duplicate records in Salesforce; customize the logic that’s used to identify duplicates; and create reports on the duplicates that users save.
Follow the below mentioned steps to use Duplicate Management
Goto> Setup > Data.com Administration >Duplicate Management
1) Create Matching Rules :- define the fields and logic of compression
2) Create Duplicate Rules :- use the Matching Rules and define the criteria so we can specify which record will and will not fall under Duplicate Rules
Note :- Duplicate Management is a Data.com technology, but does not require a Data.com license
Cheers!!!