Using the Search Interface
Search Plugin
The Plauti Deduplicate Search Plugin interface provides developers with direct access to complete duplicate search results immediately after a search is executed. Use this interface to implement custom logic—such as flagging records, triggering notifications, or modifying search outcomes—based on the search context provided in the method parameters (context, source record ID, and a map of search results).
Overview
The Search Interface allows you to insert custom logic into the duplicate search process. By implementing this interface, you can tailor how search results are handled depending on the context of the search.
flowchart LR A[Duplicate Search Initiated] --> B[Search Plugin Invoked] B --> C{Determine Context via methodName} C -- ON_LAYOUT --> D[Execute Search Plugin logic for DC Live searches] C -- ON_SEARCH --> E[Execute Search Plugin logic for DC Search searches] C -- ON_UPLOAD --> F[Execute Search Plugin logic for Bulk API/Apex insert searches] C -- ON_SINGLEUPLOAD --> G[Execute Search Plugin logic for Single API/Apex insert searches] C -- ON_CHECK --> H[Execute Search Plugin logic for DC Check searches] C -- ON_CONVERT --> I[Execute Search Plugin logic for DC Convert searches] C -- ON_WEB2LEAD --> J[Execute Search Plugin logic for web-to-lead searches] C -- ON_RVUPDATE --> K[Execute Search Plugin logic for RV Entry searches] C -- ON_INSERT; ON_UPDATE --> L[Execute Search Plugin logic for DC Entry searches] C -- ON_FLOW --> M[Execute Search Plugin logic for Flow Action searches] C -- ON_DATAAPI --> N[Execute Search Plugin logic for Data API searches]
Implementation
To implement the Search Interface, create an Apex class that implements the dupcheck.dc3Plugin.InterfaceSearch
interface. The primary method to implement is:
processResults(String methodName, Id sourceId, Map<String, List<dc3SearchResult>> searchResults)
Step 1. Create Apex Class
Ensure your class is declared as global
so that it can be referenced by the Duplicate Check framework.
Step 2. Implement `processResults` Method
methodName
: Indicates the context in which the duplicate search was performed (e.g., ON_LAYOUT, ON_SEARCH, etc.).sourceId
: Contains the record ID if the search is record-specific.searchResults
: A map where the key is the object type (represented by its prefix) and the value is a list ofdc3SearchResult
objects. Eachdc3SearchResult
instance represents a single duplicate record found during the search, including details like ranking score, object metadata, display fields, and scenario-specific scores.
Step 3. Insert Custom Logic
Use the passed metadata (method name, source ID, and search results) to drive your custom behavior. For example, log details, trigger notifications, or adjust the search results.
Step 4. Reference the Plugin in DC Settings
In your Salesforce org, navigate to the Deduplicate Setup page, then open the DC Settings section.
At the "Plugin Search" field, find the name of your custom Apex class. This registration ensures that the Plauti Deduplicate framework uses your implementation during duplicate search operations.
Supported Methods
The following method names may be passed into the processResults
method, indicating the context or source of the search.
Method Name | Description |
---|---|
ON_LAYOUT | Triggered during DC Live when a record layout is loaded. |
ON_SEARCH | Triggered when searching with DC Search |
ON_UPLOAD | Triggered during bulk insert operations. |
ON_SINGLEUPLOAD | Triggered during API or Apex insert operations. |
ON_CHECK | Triggered when using DC Check functionality. |
ON_CONVERT | Triggered during DC Convert (lead conversion). |
ON_WEB2LEAD | Triggered when the web-to-lead checkbox is used on a webform. |
ON_RVUPDATE | Triggered during RV Entry. |
ON_INSERT; ON_UPDATE | Triggered during DC Entry. |
ON_FLOW | Triggered during a Flow search. |
ON_DATAAPI | Triggered when using the Data API. |
Each of these method names helps you understand the context in which the search was initiated, allowing you to apply different logic if necessary.
Updated 17 days ago