Using the Duplicate Check Convert Interface
Convert Plugin
This article explains how to extend Plauti Deduplicate's lead conversion functionality by implementing the Convert Plugin Interface. You can use this interface to run custom logic before a lead conversion is executed, after the conversion is completed, or when a conversion fails—based on the context provided by the system.
Overview
The Convert Interface allows you to insert custom logic into the lead conversion process. The trigger is a conversion initiated by Plauti Deduplicate (manual convert, quick convert or auto convert). By implementing this interface, you can tailor the actions that occur:
beforeConvert
: Called before the lead conversion is executed. Use this method to prepare the conversion data or perform any necessary adjustments.convertFailed
: Called when the lead conversion fails. Use this method to log errors, handle exceptions, or trigger corrective actions.aferConvert
: Called after a successful conversion. Use this method to perform any necessary cleanup, update related records, or handle associated tasks.
Implementation
To implement the Convert Plugin, create an Apex class that implements the dupcheck.dc3Plugin.InterfaceConvert
interface. All methods must be implemented. The primary methods are:
global void beforeConvert(Database.LeadConvert leadConvertData)
global void convertFailed(Database.LeadConvert leadConvertData, dupcheck.dc3Exception.ConvertException exceptionData)
global void afterConvert(Database.LeadConvertResult leadConvertResult, Task taskData)
Step 1. Create Apex Class
Ensure your class is declared as global
so that it can be referenced by the Plauti Deduplicate framework.
Step 2. Implement `beforeConvert` Method
leadConvertData
: Contains all the lead conversion information. Refer to Salesforce Help for its definition and available methods.
Step 3. Implement `convertFailed` Method
leadConvertData
: Contains the lead conversion information.exceptionData
: The Salesforce exception detailing why the conversion failed.
Step 4. Implement `afterConvert` Method
leadConvertResult
: Contains the result of the lead conversion. Refer to Salesforce Help for its definition and available methods.taskData
: If a task is created upon conversion, this parameter contains that task.
Step 5. Reference the Plugin in DC Settings
In your Salesforce org, navigate to the Deduplicate Setup page, then open the DC Settings section. Under the “Convert Plugin” field, enter the name of your custom Apex class (e.g., ConvertPlugin).This registration ensures that the Duplicate Check framework uses your implementation during lead conversion operations.
flowchart TD A[Lead Conversion Initiated] --> B[Call beforeConvert] B --> C[Execute Lead Conversion] C --> D{Conversion Successful?} D -- Yes --> E[Call afterConvert] D -- No --> F[Call convertFailed] E --> G[Conversion Process Completed] F --> G
Updated 17 days ago