DupeBlocker 3 allows advanced users with development experience to further customize DupeBlocker to fit their specific business needs.
Note: Validity will not write custom code for customers nor will technical support be provided to troubleshoot custom code that is created with these options. These options are for advanced developers with Apex Code and Visualforce experience only.
Options provided include:
- Custom Unit Test Data Class
- Developers can create/reference their own test data for DupeBlocker unit tests that adheres to their specific data validation rules, field requirements and other customizations
- Redirect to Visualforce Page
- Match on Insert Action
- Allows the user to define their own custom Visualforce page to display the duplicates however they choose
- Custom Apex Code
- Match on Insert/Update Action
- Allows the user to define their own custom Apex Class to manipulate the duplicates however they choose
- Customer Matching API
- Allows for calling DupeBlocker’s duplicate checking from anywhere within custom Apex code
Custom Unit Test Data
Developers can create/reference their own test data for DupeBlocker unit tests that adheres to their specific data validation rules, field requirements and other customization. To use the custom class it must be named DB_CustomTestDataGenerator. When this class exists in the instance it will be used in place of the standard DupeBlocker Unit Test Class. This can be used to eliminate or minimize unit test failures when run all tests is selected resulting the DupeBlocker unit tests to be run.
- Sample DB_CustomTestDataGenerator.cls can be found here.
- Sample DB_CustomTestDataGeneratorTests.cls can be found here.
Redirect to Visualforce Page
This option allows users to create their own Visualforce Pages that can be called when a duplicate is detected on insert.
- Can be utilized to perform a standard "Redirect to Existing" with customized redirect text and/or to customize the fields shown in the pop-up in the upper right
- Instructions and sample code can be found in the following Validity Community Solution: DupeBlocker Custom Redirect Page: Updating Text and Adding Fields
- Users can also create their own Visualforce Pages from scratch customizing as desired
- Duplicate Id's are passed to the VisualForce Page as a URL parameter "dupes"
- If additional fields need to be displayed from the duplicate objects a new Apex Class Controller will need to be created and referenced in the Visualforce Page
- Classic - Sample Redirect Controller can be found HERE
- Classic - Sample Redirect Page can be found HERE
- Lightning - Sample Redirect Controller can be found HERE
- Lightning - Sample Redirect Page can be found HERE
Custom Apex Code and Customer Matching API
Both of these options reference a new Apex Class DB_Api. A Class Summary can be viewed under Setup -> Develop -> Apex Classes -> DB_Api.
The Custom Apex Handler is called when a specific scenario has the Match on Insert/Update Action set to Custom Apex Code (uses the selected handler specified in the scenario). "DB_Api.matches" objects (created via the DB_Api class) will be returned for that scenario.
Sample Apex Handler can be found HERE.
The Customer Matching API allows for calling DupeBlocker’s duplicate checking from anywhere within custom APEX code. "DB_Api.matches" objects (created via the DB_Api class) will be returned for ALL scenarios where matches were found.
Sample Customer Matching API can be found HERE.