How to check for similar Phone numbers in multiple fields upon entering a new record

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 "088 8888" as primary phone number and a user creates a new record 2 with the same "088 8888" as an alternative phone number, Duplicate Check duplicate prevention will trigger.
In order to cross-check two or more different fields and their values, you need to create a combined field that contains all these values.

Step 1 Create the Combined Phone fields

In this step, we are creating the combined phone fields. We will use them later in the duplicate prevention scenario. For this example, we are using the fields Phone1 and Phone2:
1.1 Navigate to Salesforce Setup menu. 
1.2 Navigate to Object Manager.
1.3 Select the Object to which you want to add the Combined Phones field.
1.4 Now, on the left menu, navigate to the "Fields & Relationships" page.
1.5 Click the 'New' button.
1.6 From the options available on the page, choose 'Formula' and click 'Next'.
1.7 Fill the blank fields:
'Field Label' with 'Combined Phones'
'Field Name' with 'Combined_Phones' 

Under 'Formula Return Type' select "Text" and click 'Next'
1.8 As a formula, insert the fields (API names), separated by a white space. In our example, those are the “Phone1” and “Phone2" fields.

Example of Combined Phone fields

    Phone1 + " " + Phone2
1.9 Under 'Blank fields handling' select "Treat blank fields as blanks". Click Next.
1.10 Apply the field-level security of your choice and click 'Next'. 
1.11 Click 'Save'.

Step 2 Create a scenario with the Combined Phone fields

2.1 Navigate to DC Setup page.
2.2 Select the Object for which you want to do a cross-check comparison in duplicate prevention.
2.3 Add the newly created field by clicking on the 'Add new Fields' button. From the drop-down menu that will show, select "Combined Phones".
2.4 For 'Matching Method' choose "Partial Fuzzy Light".
2.5 Set the 'Threshold level' to 100%. If you want fuzzy results set the threshold level at 95%.
2.6 Apply the scenario to 'Manual Insert Prevention' and 'Manual Update Prevention'.

Example Scenario

By adding the formula field to the scenario and choosing 'Partial Fuzzy Light' as the matching method, we are enabling Duplicate Check to do a cross comparison between the Phone Numbers 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 created a Search Index, please re-create it. 
3.1 You can enable the Duplicate Check Search Index for a certain *Object* in the *Object* Settings located on the DC Setup page

3.2   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 number of records in your database.

It needs to be enabled for the object where you have the formula field. Clicking the 'Create Index' button will replace the previously created index with a new one.
Click here to watch a short video of how to enable and create the Search Index.
After you have completed this article, you will be able to cross-check if there are any similar values between multiple fields upon entering a new record.

Having trouble?

Our support agents are ready to help you !