After completing this tutorial you will be able to check if there are any similar values between multiple fields upon entering a new record.
For example: If a record 1 has "email@example.com" as primary email and a user creates a new record 2 with the same "firstname.lastname@example.org" as alternative email, Duplicate Check duplicate prevention will trigger.
Step 1 Create a Combined Emails formula field
In this step, we are creating the combined email fields and use it later in the duplicate prevention scenario. For this example, we are using the fields Email1 and Email2:
||Navigate to Salesforce Setup menu
||In the search box type "Object Manager", click on it.
||Select the Object to which you want to add the Combined Emails field.
||Now, on the left menu, navigate to the "Fields & Relationships" page.
||Click the 'New' button.
||From the options available on the page, choose 'Formula' and click 'Next'.
||Fill the blank fields:
'Field Label' with 'Combined Emails'
'Field Name' with 'Combined_Emails'
Under 'Formula Return Type' select "Text" and click 'Next'
||As a formula, insert the fields (API names), separated by a white space. In our example, those are the “Email1” and “Email2" fields.
By adding the formula field to the scenario and choosing the 'Email Address' as the matching method, we are enabling Duplicate Check to do a cross comparison between the email addresses included in the formula field.
Step 3 (Re-)Create a search index
The Search Index is necessary when the new field you are going to cross-check is custom and has never been indexed before by the Duplicate Check Search Index
. If you already have a created Search Index, please re-create it.
Click here to watch a short video of how to enable and create the Search Index.
||You can enable the Duplicate Check Search Index for a certain *Object* in the *Objects* Setting located on the DC Setup page.
|| On the 'Search Index' tab, you can find the 'Create index' button. After clicking on the button it may take some time before the Search Index is created, this depends on the records number of your database.
It needs to be enabled for the object you have the formula field. Clicking the 'Create Index' button will replace the previously created index with a new one.