Salesforce - Setup Lookup

Support DQE
Support DQE
  • Updated

Custom Settings

  1. Go to the custom settings section, there will be a custom settings called "DQE Unify Lookup".
  1. Click manage and create an instance at your organization's default level.
    image_2025-04-17_154944928.png
  2. Fill all below information
  • Allow Skip : skip unify lookup suggestion to create a new record
  • App Named Cred : Name of the named credential
  • Displayed Fields : fields to be displayed in the table of the suggestion 

Access to the Record Lookup app

You can now go to the lightning Record Lookup app and click Connect at the bottom of the Setup tab. This will establish the connection between your Salesforce org and your instance of Unify Lookup Server.

image_2025-04-17_154958438.png

Record Lookup

Once the installation is complete, the Record Lookup app must be configured by following these steps:

  1. Connect it to the Customer_Dqe_one Named Credential.
  2. Upload your rule and select the object to be indexed.

Then, follow the steps below to override the standard New button with the Record Lookup button:

  1. Go to Salesforce Setup.
  2. Open Object Manager.
  3. Select the relevant object.
  4. Locate the New button.
  5. Override the button with the Record Lookup button.
ImageDQEOneButtonRecordLookup

 

This guide will walk you through how to set up the format process on a CSV file directly from the Standalone.

Guide API

In this section, we describe the set of APIs exposed by the Record Lookup app.

Federated Search

OpenSearch Description

Salesforce provides a comprehensive integration protocol for external data sources. Its full documentation can be found here.

To meet the standard of this protocol, the Unify Lookup application exposes an API respecting the XML-Atom standard in two parts, the first being the description of the format.

  • Road: /api/openSearch.xml
  • Call:

    curl -X GET \https://[YOUR APP URL]/api/openSearch.xml
  • Answer
    image_2025-04-17_155718421.png

Since the format must be unique for all responses, the list of fields is immutable. For each type of record you index in the Unify Lookup app, it is possible to map an address, email, phone number as well as first and last name.
The Source field corresponds to the type of record.
For example, if the app indexes the following Salesforce objects, some possible values are Lead, Account, Contact.
For external tables from PostgreSQL, the source is named after the table.

OpenSearch Format

The second API in the OpenSearch format is the request for a resource itself.

When this API is used from the external source search bar in your Salesforce org, the settings are passed automatically.

  • Route: /api/openSearch
  • Parameter:
    • search: (string) search terms
    • orgId: (string) the Salesforce org ID
  • Call:

    curl -X GET \https://[YOUR HEROKU APP URL]/API/OPENSearch?search=Ms. Cha Fadner&orgId=[YOUR ORG ID]
  • Answer
    image_2025-04-17_155727331.png

REST Api

Aside from the XML APIs that are geared towards being consumed from your Salesforce org, the Unify Lookup server exposes a few other APIs that allow you to perform a real-time pre-existence lookup from your external systems. In this section, we describe them one by one as well as their methods of appeal.

Authentication

It should be noted that all the APIs described below are secured by a Basic Auth. This code is composed as the login of the Identifier of the registered Salesforce organization, and as the password the license key provided by DQE-Software (the same one you had to enter in the environment variables of your Heroku application).

Search

This API is an auto-completion engine on a single search line. It allows you to obtain a list of suggested potential records that match the search criteria.

Route: /api/searchRecords

Parameters:

  • search : (string) 

Structure of the response:

The response takes the form of a list of objects structured as follows.

Key Type Description
Id string Record ID.  The internal objects of your Salesforce org are identifiers.
Spring string The name of the Salesforce object or PostgreSQL table from which the record originated
FirstName string Value in record at last indexing
LastName string Value in record at last indexing
Phone string Value in record at last indexing
Email string Value in record at last indexing
Street string Value in record at last indexing
City string Value in record at last indexing
PostalCode string Value in record at last indexing
State string Value in record at last indexing
Country string Value in record at last indexing

Example call:

curl -X GET \
-H "Authorization: Basic {authorization_header}" \
https://[YOUR HEROKU APP URL]/API/SEARCHRecords?search=Ms. Chantal Fadner

Sample answer:

[
{
"Id": "00Q0900000E3ded7FUEAZ",
"Source": "Lead",
"FirstName": "rerere",
"LastName": "azazaza",
"Phone": "0*****31",
"Email": "*****@hotmail.fr",
"Street": "R************NIERES",
"City": "A**********X",
"PostalCode": "12345",
"State": ""
"Country": "France",
}
]

Lookup

This API can be used to perform a pre-existence search by comparing a complete record with all indexed records.

Route: /api/lookupRecords

Parameters:

You can provide any key/value pair present in your form, either in the body of your query, or in the query params. Be careful to case the settings because keys not found in the records are simply ignored.

Structure of the response:

The response takes the form of a list of objects structured as follows.

Key Type Description
Id string Record ID.  The internal objects of your Salesforce org are identifiers.
Spring string The name of the Salesforce object or PostgreSQL table from which the record originated
FirstName string Value in record at last indexing
LastName string Value in record at last indexing
Phone string Value in record at last indexing
Email string Value in record at last indexing
Street string Value in record at last indexing
City string Value in record at last indexing
PostalCode string Value in record at last indexing
State string Value in record at last indexing
Country string Value in record at last indexing

Example call:

curl -X GET \
-H "Authorization: Basic {authorization_header}" \
https://[YOUR HEROKU APP URL]/API/LOOKUPRecords? Email=airelue.fc@laposte.net&PostalCode=77961&MobilePhone&Phone=0695473336&Street=Rue du Clos Gillet&FirstName=Aurélie&LastName=FUALKNER

Sample answer:

[
{
"Phone": "**********",
"City": "A*****LE",
"FirstName": "Au****ei",
"MobilePhone": "",
"State": "",
"PostalCode": "12345",
"LastName": "F****ER",
"Country": "France",
"Email": "ai******@laposte.net",
"Street": "Rue ********et",
"Id": "00Q0900000E37F3EAJ",
"Source": "Lead"
},
{
"Phone": "",
"City": "A*****LLE",
"FirstName": "A*****ie",
"MobilePhone": "",
"State": "",
"PostalCode": "12345",
"LastName": "FU*****ER",
"Country": "France",
"Email": "a********c@laposte.net",
"Street": "Ru*****et",
"Id": "00Q0900000E37F1EAJ",
"Source": "Lead"
}
]

If no deduplication rule sets have been imported into your application:

{
"status": "error",
"error": "No rules set loaded yet"
}

Golden record

This API can be used to perform a pre-existence search by comparing a complete record with all indexed records. But unlike the previous one, it will only return the card with the best match score.

Route: /api/lookupGolden

Parameters:

You can provide any key/value pair present in your form either in the body of your query or in the query params. Be careful to case the settings because keys not found in the records are simply ignored.

Structure of the response:

Key Type Description
Certainty float Match Rate
Matched_by string The name of the deduplication rule that brought this card closer to your record.
Id string Record ID.  The internal objects of your Salesforce org are identifiers.
Spring string The name of the Salesforce object or PostgreSQL table from which the record originated
FirstName string Value in record at last indexing
LastName string Value in record at last indexing
Phone string Value in record at last indexing
Email string Value in record at last indexing
Street string Value in record at last indexing
City string Value in record at last indexing
PostalCode string Value in record at last indexing
State string Value in record at last indexing
Country string Value in record at last indexing

Examples of calls:

  • GET:
curl -X GET \
-H "Authorization: Basic {authorization_header}" \
https://[YOUR APP URL]/api/lookupGolden? Email=ai************.net&PostalCode=1234&MobilePhone&Phone=*******&Street=Ru*********t&FirstName=A******&LastName=F*****
  • POST:
curl --location 'https://[YOUR APP URL] /api/lookupGolden' \
--header "Authorization: Basic {authorization_header}" \
--header 'Content-Type: text/plain' \
--data-raw '{
"recordType": "PersonAccount",
"FirstName": "S*****",
"LastName": "T****",
"PersonEmail": "s************id"

}'

Sample answer:

  • If a match has been found in the database and the query is well formed
{
"certainty": 0.05298333333333333335,
"matched_by": "Address",
"record": {
"Phone": "***************",
"City": "**********",
"FirstName": "Au***********",
"MobilePhone": "",
"State": "",
"PostalCode": "12345",
"LastName": "*******************",
"Country": "France",
"Email": "******************.net",
"Street": "Rue ****************et",
"Id": "00Q0900000E37F3EAJ",
"Source": "Lead"
}
}
  • If no deduplication rule sets have been imported into your application
{
"status": "error",
"error": "No rules set loaded yet"
}
  • In all other cases
{
"status": "error",
"error": "bad request"
}

Add record

If you want to add a record to your indexing registry without having to restart a process across your entire Salesforce database, you can use this API by providing the card you want to index.

Route: /api/add

Parameters:

  • recordType: SObject API Name (e.g. Lead, Account, Contact...)
  • Id: Salesforce Id

You can also provide any key/value pair present in your record in the query params during this call. Be careful to case the settings because keys not found in the records are simply ignored.

Examples of calls:

  • GET:
curl -X GET \
-H "Authorization: Basic {authorization_header}" \
https://[YOUR HEROKU APP URL]/api/add?recordType=Lead&Email=a************e.net&PostalCode=12345&MobilePhone&Phone=0************&Street=Rue*************&FirstName=A**********&LastName=F********R
  • POST:
curl --location 'https://[YOUR HEROKU APP URL]/API/ADD' \
--header 'Authorization: Basic {authorization_header}' \
--header 'Content-Type: text/plain' \
--data-raw '{"0": {
"Phone":"0***********6",
"BillingStreet":"R***********t",
"BillingPostalCode":"12345",
"LastName":"*****",
"PersonEmail":"a**************t",
"BillingCity":"H*****************Y",
"id":"[SALESFORCE ID]",
"FirstName":"A****************e",
"attributes": {"type":"PersonAccount"}
}
}'

Sample answer:

  • If the operation is successful
{
"status": "success",
"label": "Record added"
}
  • If the object's API name isn't one of the objects that are currently allowed to be indexed:
{
"status": "error",
"label": "RecordType not mapped in your application"
}

In this case, it is necessary to go to the ligthning Unify Lookup app and add the object.

  • If the record could not be added because the redis database is running out of storage:
{
"status": "error",
"label": "memory > max memory"
}
  • In all other cases
{
"status": "error",
"error": "bad request"
}

Remove record

If you want to delete a record from your indexing registry without having to restart a process across your entire Salesforce database, you can use this API by providing the card you want to index.

Route: /api/delete

Parameters:

  • recordType: SObject API Name (e.g. Lead, Account, Contact...)
  • Id: Salesforce Id

You can also provide any key/value pair present in your record in the query params during this call. Be careful to case the settings because keys not found in the records are simply ignored.

Examples of calls:

  • Delete a single record
curl -X GET
-H "Authorization: Basic {authorization_header}"
https://[YOUR HEROKU APP URL]/API/DELETE? Id=00DX00000DJ19Q&recordType=Lead&Email=a*********net&PostalCode=12345&MobilePhone&Phone=0**6&Street=R*et&FirstName=A*e&LastName=*
  • Delete a multiple records
curl -X POST https://[YOUR HEROKU APP URL]/API/DELETE
-H "Authorization: Basic {authorization_header}"
-d "[JSON Data]"

The json body should be structured as follows:

{
recordId: {
"attributes": {
"type": recordType
}
},
recordId: {
"attributes": {
"type": recordType
}
}
}

Sample answer:

  • If the operation is successful
{
"status": "success",
"label": "Record(s) removed"
}
  • In all other cases
{
"status": "error",
"error": "Failed to remove record"
}

Index Database

This API allows you to start the global indexing process on an object. It requires that the object is already added (via the interface) to the list of objects, and that a "ruleset" is configured for it.

Route: /api/add

Parameters:

  • recordType: SObject API Name (e.g. Lead, Account, Contact...)
  • Target: Salesforce Org URL (in https://xxx format.my.salesforce.com)
  • token: valid Salesforce session token
  • User: The Salesforce username associated with the session token

Example call:

  • GET:
curl -X GET \
-H "Authorization: Basic {authorization_header}" \
https://[YOUR HEROKU APP URL]/API/INDEX?recordType=Lead&token=XXXXXXXXXX&user=myusername@test.com&target=mysforg.my.salesforce.com

Sample answer:

  • If the operation is successful:
{
"status": "success",
"label": "indexing by Bulk started"
}
  • If the object's API name isn't one of the objects that are currently allowed to be indexed:
{
"status": "error",
"label": "RecordType not mapped in your application"
}

In this case, it is necessary to go to the ligthning Unify Lookup app and add the object.

  • In all other cases:
{
    "status": "error",
    "error": "bad request"
}

APEX Rest Resources

The AppExchange Unify Lookup package provides resources in the form of Apex classes that can be invoked from your Apex classes but also in the form of APIs.

Authentication

The API resources described below can only be accessed by providing a valid Salesforce token retrieved through the OAuth2 API. The {authorization_header variable in the following examples represents this session token.

UpdateDB

To insert or remove records from the indexed database, you can use this REST resource. All you have to do is provide it with the record identifiers, the type of object and the operation to be applied.

Route: [YOUR SALESFORCE DOMAIN]/services/apexrest/UnifyLookup/updateDB/

Parameters:

  • ids : Salesforce Records Identifiers Separated by Commas
  • recordType: SObject API Name (e.g. Lead, Account, Contact...)
  • Action: Insert or Delete

Example of a call:

curl -X GET https://[YOUR SALESFORCE DOMAIN]/services/apexrest/UnifyLookup/updateDB/?
ids=0017R00002ryGbZQAU,0017R00002kqzFHQAY&sObjectName=Account&action=insert
-H "Authorization: Bearer {authorization_header}"

Sample answer:

  • If the operation (insert) is successful:
{
"status": "success",
"label": "Record added"
}
  • If any error occurs:
{
"status": "error",
"label": "Failed to add record"
}

Calling from an apex class

It is also possible to call the function directly from your apex functions because the apex function is defined as global.

  • deleteRecord
List<String> ids = new List<String>{'0017R00002ryGbZQAU', '0017R00002kqzFHQAY'};
String sObjectName = 'Account';
Map<String, String> res = UnifyLookup.DQE_Lookup_update_db.deleteRecord(ids, sObjectName);
  • insertRecord
List<String> ids = new List<String>{'0017R00002ryGbZQAU', '0017R00002kqzFHQAY'};
String sObjectName = 'Account';
Map<String, String> res = UnifyLookup.DQE_Lookup_update_db.insertRecord(ids, sObjectName);

Related to

Was this article helpful?

0 out of 0 found this helpful