1. Create a Combined Phone formula field
First, create a formula field for the combined phone fields. This field will be used in the duplicate prevention scenario to cross-check the values of the different phone fields. In this example the fields Phone1 and Phone2 will be cross-checked for similar values.
- Go to the Salesforce Setup menu > Object Manager.
- Select the Object where you want to add the Combined Phones field.
- At left, go to Fields & Relationships.
- Click New.
- From the given options for the new field, choose Formula and click Next.
- Enter a field label and field name:
- At Field Label, enter Combined Phones
- At Field Name, enter Combined_Phones
- At Formula Return Type select "Text" and click Next
- As a formula, insert the following formula, including the API names of the different fields you want to check. In the example below, those are the “Phone1” and “Phone2" fields.
Example of Combined Phone field formula:SUBSTITUTE(SUBSTITUTE( SUBSTITUTE( SUBSTITUTE( SUBSTITUTE( Phone , "(", ""), ")", ""), " ", ""), "-", ""), "+", "")
+ " " + SUBSTITUTE(SUBSTITUTE( SUBSTITUTE( SUBSTITUTE( SUBSTITUTE( MobilePhone , "(", ""), ")", ""), " ", ""), "-", ""), "+", "") - At the Advanced tab, at Blank fields handling, select "Treat blank fields as blanks". Click Next.
- Apply the field-level security of your choice and click Next.
- Click Save.
2. Create a scenario with the Combined Phone fields
- Go to the DC Setup page.
- Select the Object for which you want to do a cross-check comparison in duplicate prevention.
- Add the newly created field by clicking Add New Field. In the drop-down menu, select "Combined Phones".
- For Matching Method, choose "Partial Exact".
- Set the Threshold level to 100%.
- Apply the scenario to "Manual Insert Prevention" and "Manual Update Prevention".
3. (Re-)Create the Search Index
Create or Recreate the Search Index. This applies both if the new field you are going to cross-check is custom and has never been indexed before by the Duplicate Check Search Index, and if you already have created a Search Index in the past.
- Go to DC Setup.
- On the left hand side, under Object Setup, select the Object you want to (re-)create a Search Index for.
- On the *Object* Settings tab, make sure the Search Index option is enabled, and the search index is configured in the Advanced Settings > Index. Read more here.
- Go to the Index Batch tab.
- Click the Start button and select Create Search Index.
Click here to watch a short video of how to enable and create the Search Index.