Potential Duplicates Subgrid Web Resource

This article describes the read-only version of the Potential Duplicates web resource. See the newer Field-Chooser/Editor version here.

Potential Duplicates Subgrid Focus
Potential Duplicates Subgrid Focus

We recently added the ability to show potential duplicates in a grid within the CRM Form. This component gives all the same functionality as the list view of duplicates: Set Primary, Ignore and AutoMerge. The main advantage of seeing potential duplicates in the form is that your end-users (the actual owners of the records) can be prompted to AutoMerge them as they discover them as opposed to having an IT/Analyst type person deal with them en masse from the list view (which is not politically feasible in many organizations)

Potential Duplicates Subgrid
Potential Duplicates Subgrid

The above screenshot shows how we customized the OOB Contact form on our demo org.

You can do the same. The custom form we include in the AutoMerge Managed Solution (form name “AutoMerge”) has the Potential Duplicates subgrid (web resource) configured on it so if you have either Administrator or Customizer roles, you should be able to see it and copy it to the form your end-users are looking at.

The web resource has two visible components: the grid showing the records of the duplicate set, and the notification in the upper left.  Both of these are customizable to your particular needs by editing the Custom Parameters(data) when you add the web resource component to a CRM form. The JSON string we put in that field instructs the web resource how to render itself.

Potential Duplicates Web Resource Properties
Potential Duplicates Web Resource Properties

In the screenshot above the Custom Parameters(data) field is where the JSON string is defined. As mentioned, you can copy the string from the web resource on the form named “AutoMerge”. 

Here is default JSON string for Contacts: 

{
"Comment" : "Go to https://automerge.com/userguide#potentialduplicates for instructions",
"fieldList": [

[
"Rank",
"gnb_automergerank"
],
[
"Match Type",
"gnb_automergematchtype"
],
[
"Precision %",
"gnb_automergematchprecisionsingle"
],
[
"First Name",
"firstname"
],
[
"Last Name",
"lastname"
],
[
"Email",
"emailaddress1"
],
[
"Mobile Phone",
"mobilephone"
],
[
"Business Phone",
"telephone1"
],
[
"Home Phone",
"telephone2"
],
[
"Street 1",
"address1_line1"
],
[
"City",
"address1_city"
],
[
"ZIP/PostalCode",
"address1_postalcode"
]
],
"rowSize": "md",
"showCurrentRecord": true,
"isClickable": true,
"openRecordNewWindow": false,
"autoMergeButtonText":"AutoMerge",
"ignoreButtonName": "Ignore",
"setPrimaryButtonName": "MakeWinner",
"targetEntityLogicalName": "contact",
"orderFields": [
["gnb_automergerank","asc"],
["gnb_automergematchprecisionsingle", "desc"]
],
"notificationText": "AutoMerge analysis found {0} potential duplicate(s) of this Contact, see section below.",
"queryParameters": [
{
"Filter1": "gnb_automergetag",
"FilterType1": "String",
"FilterValue1": "##gnb_automergetag"
},
{
"Filter2": "statecode",
"FilterType2": "OptionSet",
"FilterValue2": "0"
}
]
}

Let’s dig into the some of the elements in the JSON string. I’m skipping the obvious ones.

  • fieldList: you define your columns here.
    • the first string is the column title
    • and the second is the schemaname of the field
  • rowSize: this must be one of “sm”, “md” or “lg”
  • showCurrentRecord: if true then the record in main part the form is also shown in the grid in bold
  • autoMergeButtonText: if set to an empty string “” the button will not appear
  • ignoreButtonName: (same) if set to “” the button will not appear
  • setPrimaryButtonName: (same) if set to “” the button will not appear
  • orderFields: list of up to 10 sort field pairs: schemaname & sort-direction (“asc” or “desc”)
  • queryParameters: you can define up to 10 filters.
    Each has three parts (increment the “N” each time)
    • FilterN: schemaname
    • FilterTypeN: one of “String” / “OptionSet” / “Lookup” 
    • FilterValueN: is either
      • a static value like “0
      • or a variable like “##gnb_automergetag
        …in other words, show all records whose gnb_automergetag field EQUALS  the gnb_automergetag field of the current record

As you can see, this is a highly customizable web resource. It can show records related to the main record based on any matching field (typically string type fields), which gives you a lot more flexibility than the built-in subgrid functionality where you need a defined relationship between the records.

And yes, you can use this web resource for non-AutoMerge related purposes. We just don’t have the bandwidth to support you in that endeavor. 🙂

Grab our latest AutoMerge Managed Solution from our Resources Page.

Happy AutoMerging!

Copyright © 2020 AutoMerge