Another Salesforce blog!!!

Salesforce, Apex

Managing Duplicates Records with Duplicate Rules

Prevent duplicate names and provide custom error messages using duplicate rules

Step 1: Creating MATCHING RULES:

Setup--> Administration

-->Duplicate Management
-->Matching Rules (Click)
-->Select the object 
--> Rule Name: "Unique Name matching rule" (of whatever it suites your needs)
--> Field: Name
--> Matching Method: Exact

Step 2: Creating DUPLICATE RULES:

Setup–> Administration

-->Duplicate Management
-->Duplicate Rules (Click)
-->New Rule
-->Select the object 
-->Rule Name: "Unique Name" (of whatever it suites your needs)
-->Record-Level Security: Enforce sharing rules
-->Action on Create/Edit: Block
-->Compare Merchants With: <select your object>
-->Matching Rule: select the matching rules you have created in the STEP 1

Leave a Reply

Your email address will not be published. Required fields are marked *