LogoLogo
  • Delpha Documentation
    • Welcome to Delpha Documentation
    • Delpha Setup
      • Install Delpha
        • Install Delpha package from the Salesforce App Exchange
        • Activate Delpha
        • Assign a Delpha Permission Set Group
        • Assign a Delpha licence to the users
        • Connect the org to Delpha
      • Import Conversations
      • Extra Tasks
        • Check my org settings
        • Install Delpha Connector for LinkedIn Enrichment
    • Delpha Upgrade
    • Delpha Apps
      • Delpha Setup
        • Delpha configuration
          • First Steps
          • Token Usage
          • Data Quality - Account
          • Data Quality - Contact
          • Duplicates
          • Job Tracker
          • Default Values
        • Conversations
        • Conversation Builder
          • High-level overview of the conversation builder
      • Delpha Data Quality
        • Data Quality Steward view
        • Duplicate Data Steward view
      • Delpha Score Meter
    • Use Cases Setup
      • Duplicate
        • Setup
          • Initialize the default settings
          • Activate Auto Merge
        • Duplicate detection
          • Properties section
          • Fields section
        • Run your first duplicate detection
        • Duplicate remediation
          • Merge Object Rules section
            • Master Record Selection
            • Custom rule for Master Record selection
            • Default rules for field selection
          • Merge Field Rules section
      • Data Quality
  • Delpha Campaigns
    • Create a Delpha Campaign
    • Configure a Delpha Campaign
      • Select the Campaign Type
        • Lead Generation
        • Job Tracking
        • Account Generation
      • Review and update the Settings
      • Add Campaign Members
  • HOW TO - FAQ
    • Quick Start Guide
    • Delpha Integration
      • How to add Delpha components in my standard layout
      • How can I add Delpha fields in my standard layout
      • How to manage conversation priority
      • How to manage the conversation auto opening
    • Delpha Job Tracking
      • How to display the Job History
      • How does job tracking works
    • Delpha LinkedIn Connector
      • How can I connect my LinkedIn Account to Delpha
      • I am not allowed to install Delpha Connector on my browser
      • How many records can be enriched with LinkedIn in a day per user?
      • How can I check if a LinkedIn cookie is properly set or valid
      • How is used my LinkedIn Cookie
      • How can I automate my lead generation
    • Delpha Duplicate
      • What is a Filtering Rule and how to use it
      • What is the Expression and how to use it
      • How to exclude records from the analysis
      • How to make Duplicate Records exclusion dynamic
      • How to Fix Duplicates in Salesforce with Delpha – Automatic, Bulk & Manual Options
      • How to modify the detection threshold
      • How to modify the auto process threshold
      • What algorithms are used by Delpha
      • How does the Duplicate scoring work
      • How to define a Golden Record for Duplicate
      • How do you differentiate Do Not Compare & Is Golden Record
      • How to sync Salesforce & Hubspot to deduplicate records
      • Duplicate detection - When does it happen?
      • How to set the frequency of the Auto Merge
      • How to create a Master selection custom rule
      • How to create a Master selection custom rule - Advanced
      • What are the duplicate status?
      • How to Merge 2 leads with different currencies
      • What is a Duplicate credit?
      • Do I consume a credit when merging a pair?
      • What is field grouping?
      • How can I hide a field from the Delpha Bot conversation?
      • How can I keep both values of a field after the merge
      • Some duplicate are not detected, what can I do?
      • Can I ignore some field values when detecting duplicates?
      • What data is available for Duplicate?
      • How can I create custom reports on Duplicate
    • Delpha Data quality
      • What are the 6 data quality dimensions
      • How to exclude records from the analysis
      • How to fix my data quality
      • What is a Token?
      • Do I consume a token when applying a Delpha recommendation?
      • Data Quality for Contacts
        • What are Data Quality Dimensions for Email
        • What are the Data Quality fields for Email
  • Delpha Campaigns
    • How to add records to a campaign from reports?
  • TROUBLESHOOT
    • Grant access for Delpha Support
Powered by GitBook
On this page
  • How to Use a Custom Formula for Complex Master Record Selection
  • When to Use a Formula-Based Master Rule
  • Step-by-Step Setup
  • 1. Create a Custom Formula Field
  • 2. Add Your Logic in the Formula Field
  • 3. Use It in Delpha Duplicate Settings

Was this helpful?

Export as PDF
  1. HOW TO - FAQ
  2. Delpha Duplicate

How to create a Master selection custom rule - Advanced

Create custom formula-based scoring to define complex master record selection rules in Delpha. Learn to sort duplicates based on business logic in Salesforce.

How to Use a Custom Formula for Complex Master Record Selection

In some cases, selecting a master record based on a simple value comparison (like highest number or checkbox = true) isn’t enough. When your business logic is more advanced, the best approach is to create a custom formula field that scores each record based on multiple conditions.

This score is then used to sort the duplicate pair and select the master record.

When to Use a Formula-Based Master Rule

Use a formula when:

  • You need to prioritize based on a combination of picklists, metrics, and dates

  • You want to handle tie-breaker logic across several layers

  • Your logic changes based on status, recency, or business value

Step-by-Step Setup

1. Create a Custom Formula Field

  • Object: Account, Contact, or Lead (where duplicates occur)

  • Field Type: Formula

  • Return Type: Number

  • Example API Name: MyDuplicateMasterRecordScore__c

2. Add Your Logic in the Formula Field

Here’s a complete example based on business rules:

salesforceCopyEditCASE(
   Status__c,
   "Customer", 10000,      /* Rule 1: Always prioritize Customer */
   "Prospect", 5000,       /* Rule 3: Prospect over Target */
   "Target", 1000,
   0
) +
IF(
   AND(Status__c = "Customer", NOT(ISBLANK(Number_of_Opportunities__c))),
   Number_of_Opportunities__c * 10,  /* Rule 2: More Opps wins among Customers */
   0
) +
IF(
   AND(Status__c = "Prospect", Last_Touchpoint_Date__c < TODAY() - 180),
   -4000,  /* Penalize cold Prospects */
   0
) +
(100000000 - CreatedDate) /* Rule 4: Prefer oldest if all else equal */

This formula returns a numeric score. The record with the highest score becomes the master during the merge.

3. Use It in Delpha Duplicate Settings

In Delpha Setup → Duplicate Settings, set the Master Rule to:

MyDuplicateMasterRecordScore__c DESC, CreatedDate ASC

What This Covers

  • Rule 1: Always select Customer as master

  • Rule 2: Among Customers, prioritize by # of Opportunities

  • Rule 3: Prefer Prospect over Target, unless the Prospect is outdated

  • Rule 4: Use Created Date as fallback

PreviousHow to create a Master selection custom ruleNextWhat are the duplicate status?

Last updated 1 day ago

Was this helpful?