The independent daily for Salesforce admins, developers and architects

Curated by Abhinav (opens in a new tab)

Using Duplicate Rules and Matching Rules to stop Duplicate records in Salesforce (opens in a new tab)

You will learn how duplicate rules and matching rules work together, how to choose matching criteria, and a practical order for rolling out Alert and Block modes with a regular cleanup routine.

  1. Enable duplicate rules in Alert mode
  2. Watch alerts for about two weeks
  3. Fix matching rules that are too loose or tight
  4. Switch worst offenders to Block
  5. Schedule a monthly duplicate cleanup
The suggested order for rolling out duplicate rules

Duplicate records quietly undermine reporting in a Salesforce org. Duplicate Rules watch records as they are created or edited and compare them against existing records using a Matching Rule. When a match is found, the rule either blocks the save or warns the user. The article recommends starting in Alert mode, since a hard block on leads can stop reps from logging genuine new opportunities.

The Matching Rule determines how well the Duplicate Rule performs. The article suggests matching contacts and leads on email, which it describes as the most reliable single identifier, and matching accounts on name plus a second field such as website, phone or billing city, because name alone produces false positives. Fuzzy matching, where offered, catches variants like Jon and John Smith, and the matching threshold should be set so that users are not warned constantly.

Duplicates usually enter through Web-to-Lead and data imports, manual entry, and integrations whose matching criteria do not line up with the Duplicate Rules. Existing duplicates are handled separately with Duplicate Record Sets and the Potential Duplicates component on record pages. When merging, the article advises keeping the record with the most history and assigning the merge process to one or two admins on a monthly schedule.

The suggested setup order is to enable Duplicate Rules in Alert mode for accounts, contacts and leads, watch the alerts for about two weeks, adjust matching if users ignore alerts or never see them, then move the worst offenders to Block. Required fields such as email or company can further improve matching reliability.

Read the original at dev.to (opens in a new tab)

Worth reading?

Recommended

Fixing Data in a before-save Flow instead of blocking users with Validation Rules (opens in a new tab)

You will learn how a before-save Record-Triggered Flow can correct a field value before a Validation Rule evaluates it, so users are not stopped by errors.

Why read this

You will also see when a Validation Rule should stay and how to make it less disruptive.

Validation Rule

  • Checks the value as entered
  • Blocks the save with an error
  • User must fix the value by hand

Before-save flow

  • Corrects the value before the check
  • Record saves with no error
  • Works for UI, API and Data Loader
Validation Rule blocks the save, while a before-save flow corrects the value first

The author opens with a sales manager whose reps kept personal spreadsheets because repeated validation errors made Salesforce slow to use. He argues that some Validation Rules can be replaced by logic that corrects the data instead of rejecting it.

A Record-Triggered Flow set to Fast Field Updates runs before the record is saved, ahead of Apex before triggers and Validation Rules. A corrected value is therefore what the Validation Rule checks, so the user sees no error. The same applies to every source that saves the record, including the UI, the API and Data Loader.

As an example, a rule requiring the Website field on Account to start with http or https can be replaced by a flow. The flow uses a formula resource that prefixes https:// when needed, then an Assignment element sets the field back on $Record. No Update Records element is needed, and the author advises testing in a sandbox and deactivating the rule while keeping its formula in the description. Other candidates include forcing uppercase codes, stripping dashes from tax IDs and deriving a region from a country.

Where the correct value cannot be inferred, as with a loss reason on a Closed Lost opportunity, the rule should stay but be made less painful. The author suggests showing the field only when relevant with Dynamic Forms, marking it required on the page, placing the error on the field, and scoping the formula with ISCHANGED(StageName).

Read the original at dev.to (opens in a new tab)

Worth reading?

Must-read

How the DataGroomr MCP Server exposes Salesforce data-quality work to AI assistants (opens in a new tab)

You will learn what DataGroomr's MCP Server lets AI assistants do in Salesforce, which controls govern it, and how its preview, approval and audit mechanisms work for merges.

Why read this

You will also see the author's argument that permissions decide who may merge but nothing scores whether a merge should happen.

Launch release

  • Individual Salesforce identities
  • Permissions decide access
  • No per-operation decision score
  • Undo after the fact only

Support docs add

  • Three tool presets
  • Irreversible merge badge
  • Preview as default write mode
  • Approval prompt and audit log
What the launch release names compared with what the support docs add

DataGroomr launched an MCP Server on November 23, 2026 that lets AI assistants such as Agentforce, Claude and ChatGPT carry out Salesforce data-quality work in natural language. The article says the release groups the capabilities into four areas: data quality insights, duplicate detection and verification, data quality operations, and AI-assisted configuration. Authorized users can find and merge duplicates, verify contact fields, and start cleansing workflows within DataGroomr’s existing permissions.

According to the article, the launch release names individual Salesforce identities as the main control, so a user reaches only what their role, license and DataGroomr permissions allow. Administrators decide which tools are exposed and who may connect. The article notes that the release names no per-operation decision score and no confirmation step before a merge. Undo is offered only after the fact. It also says the server is available on Trial and Enterprise plans, and that no separate MCP price was named, so pricing could not be verified.

The article then adds controls from DataGroomr’s support documentation. Admins choose tools from three presets: Read Only, Read + Record Actions, and Everything. Tools carry effect badges, and merges are marked Irreversible. A Write Mode setting defaults to Preview, which shows what a change will do before it runs. Per the November release notes, write actions run only after the AI client’s own approval prompt is confirmed, and every call is logged in the Log Browser and Integration Activity audit page.

The author argues that preview, approval and logging are useful but do not score whether a given merge should happen before it runs. The article includes the author’s own gate tests on the server’s tool scopes, which it describes as a demonstration harness rather than the product, and it notes that one non-allowlisted merge was auto-approved in that harness. Treat the article’s comparisons and self-tests as the author’s own material, since it is written by a vendor of a competing decision service.

Read the original at dev.to (opens in a new tab)

Worth reading?

Recommended

Staging an AI agent's Salesforce access in three permission levels (opens in a new tab)

You will learn a staged way to grant an AI agent access to Opportunity data: read first, then propose tasks, then write a few fields.

Why read this

You will also see how the staging exposes data gaps and undocumented exceptions before any record changes.

  1. Level 1: read Opportunity and activities
  2. Level 2: propose Tasks for the owner
  3. Level 3: write a few fields
The agent gains write access only after each lower level works

The author describes an AI agent that reviews Salesforce Opportunities with no activity for 30 days, checks recent interactions and prepares follow-up actions. The design question is what the agent is allowed to do, and the author splits this into three permission levels that the agent moves through only once the level below works.

At level 1 the agent only reads Opportunity, its activities and OpportunityHistory. It runs under its own integration user with a Permission Set limited to the objects and fields it needs, and any tool layer such as MCP exposes read tools only. Every query is logged with its filter. This level shows whether no movement is defined well, since LastActivityDate, stage changes in OpportunityHistory and LastModifiedDate give different lists, and LastModifiedDate also moves when a Flow, integration or bulk load touches a record.

At level 2 the agent proposes rather than edits, creating a Task for the Opportunity owner with the suggested next step, WhatId set to the Opportunity, OwnerId set to the owner and a subject prefix that marks it as agent-written. A person decides what happens. This level reveals exceptions, such as deals deliberately paused, which the agent cannot know unless they are stored in a field, and data gaps, such as calls logged outside Salesforce. The author suggests counting open Opportunities with no LastActivityDate and fixing the data before moving on.

At level 3 the agent writes a few fields, such as a next step or follow-up date, with field-level security keeping the rest read-only. Exceptions are encoded in the query, for example skipping records with a future resume date, and changes are tested in a sandbox with realistic data. Because the agent has its own user, LastModifiedById and field history separate its changes from people’s. The author’s point is that a wrong filter at level 3 corrupts every matching record at once, so the staging keeps mistakes cheap.

Read the original at dev.to (opens in a new tab)

Worth reading?

Recommended

Mining OpportunityHistory with pandas to see how sales really run before automating (opens in a new tab)

You will learn how to turn the OpportunityHistory object into an event log and use pandas to find stage variants, skipped stages, waiting times and single-person bottlenecks.

Why read this

You will also see what these findings should settle before an AI agent is given the sales process.

  1. Export OpportunityHistory as an event log
  2. Build stage variants and count rework
  3. Measure median wait between stages
  4. Count who moves the stages
The four analyses used to measure the real sales process from OpportunityHistory

The author argues that a documented sales process often differs from the one a company actually runs, and that an AI agent will faithfully follow whichever version it is given. Before automating, teams should measure the real process. Salesforce already records a row in OpportunityHistory whenever an opportunity’s stage, amount or close date changes, so no setup is needed. A SOQL query selecting the opportunity ID, stage, amount, close date, creation date and creator over the last 180 days can be exported to CSV and used as an event log.

The post then walks through four analyses in pandas. The first removes rows that are not real stage changes and counts the distinct stage paths, or variants, across opportunities; the documented process is usually one line, while the data usually shows many. The second flags opportunities that went back to an earlier stage and those that moved from creation to the last stage in two steps or fewer, which suggests the CRM was updated only at the end. The third calculates the median wait between each pair of stages to locate handoffs or approvals that happen outside the system. The fourth counts how many stage changes each user made, since one or two users moving most records suggests updates are being collected elsewhere and typed in.

The author stresses that these numbers show where the problems are, not why they occur. Each signal should prompt a question: which process is the real one, what the rep gains from updating the CRM, which area owns a slow handoff, and where the information actually lives. Answering these first prevents an agent from speeding up the wrong steps. The same approach can extend to orders, invoices and payments when the ERP lives in the same Salesforce org.

Read the original at dev.to (opens in a new tab)

Worth reading?

Recommended

Finding hidden duplicate accounts after a Salesforce Data migration (opens in a new tab)

You will learn how to normalise legacy keys, count duplicates in a spreadsheet and in SOQL, separate true duplicates from key collisions, and repoint child records before deleting a duplicate Account.

  1. Normalise the legacy key
  2. Count raw and normalised keys
  3. Classify each duplicate group
  4. Repoint child records
  5. Delete the duplicate
The duplicate clean-up sequence for migrated Accounts

Matching record counts after a migration can hide duplicates. Re-run loads, insert calls used where an upsert on an External ID was needed, and keys that differ only by case, spaces or leading zeros all leave duplicates behind. Salesforce duplicate and matching rules do not examine a legacy key unless a rule is built for it.

The article walks through normalising the key with spreadsheet formulas, counting raw and normalised keys, and classifying each group as unique, exact duplicate, hidden duplicate or key collision. A SOQL GROUP BY query with HAVING clause provides the same check inside the org, though it catches case differences only, not leading zeros or trailing spaces.

Before deleting anything, the author chooses a survivor, usually the Account with the most Contacts, and repoints Contacts, Opportunities and Cases to it with Data Loader or the Account merge operation. The checklist ends with marking the External ID field Unique so the next load cannot insert the same key twice.

Read the original at dev.to (opens in a new tab)

Worth reading?

Six practical Validation Rule patterns to improve data quality in Salesforce (opens in a new tab)

Readers will learn six ready-to-use Validation Rule formulas that prevent common data entry mistakes, along with best practices for writing clear field-level error messages.

  1. User enters or edits a record
  2. Validation Rule formula is evaluated
  3. Bad data is blocked with a clear error
  4. Error appears at the field level
How a Validation Rule stops bad data before it is saved, using the article's approach

The article outlines six Validation Rule patterns designed to catch frequent user errors without requiring Apex or Flow. These include preventing Closed Won Opportunities from missing amounts or close dates, blocking Cases with backdated open dates beyond a seven day window, and ensuring close dates never precede creation dates.

Additional patterns address picklist state management by stopping records from reverting to New once closed, unless a custom bypass permission is granted. The piece also requires a reason field when priority changes to High status, and locks amount fields during approval reviews to prevent revenue leakage.

Beyond the formulas, the author emphasizes error message hygiene. Rules should be named clearly, descriptions filled out for audits, and errors placed at the field level rather than the page header. Messages must instruct users on the correct action instead of simply stating an invalid value. The author notes that while Validation Rules stop immediate data issues, field level required attributes or Flow notifications may be better alternatives for certain workflows.

Read the original at dev.to (opens in a new tab)

Worth reading?

Recommended

Implementing email verification workflows in Salesforce beyond standard Validation Rules (opens in a new tab)

You will learn how to distinguish between email formatting checks and actual deliverability verification, and how to build a reliable workflow using Custom Fields, flows, and external APIs.

Why read this

The piece outlines trigger points, error handling, and monitoring metrics to maintain CRM data quality.

The article distinguishes between email validation, which enforces syntax through a Validation Rule, and email verification, which confirms domain existence, mail server configuration, and mailbox deliverability. Standard format checks cannot prevent bounces or identify disposable addresses.

It recommends placing verification at record creation, during field updates, or through bulk cleanup processes. A practical workflow involves creating a Custom Field, defining trigger events, calling an external verification service via API or managed package, and applying business rules to route verified, invalid, or risky addresses accordingly.

Developers are advised to handle inconclusive results gracefully, avoid redundant processing, maintain audit trails, and respect consent and privacy requirements. The author notes that while custom integrations offer flexibility, native applications can reduce maintenance overhead, and ongoing monitoring of bounce rates and verification metrics ensures the workflow actually improves data quality.

Read the original at dev.to (opens in a new tab)

Worth reading?

A practical workflow for cleaning Salesforce data before implementing AI (opens in a new tab)

Readers will learn a structured five-step process for auditing and cleaning Salesforce records before deploying artificial intelligence features.

Why read this

The piece explains how to automate ongoing data hygiene using standard administrative tools to prevent model failures.

The article argues that artificial intelligence initiatives in Salesforce consistently fail when trained on unclean data, emphasizing that pattern matching models amplify existing record errors rather than masking them. Common issues include duplicate contacts and leads, incomplete required fields, inconsistent Picklist values, and stale records that cause Agentforce assistants to route cases incorrectly or generate inaccurate summaries.

To address these problems, the author recommends running a comprehensive data audit before approving any artificial intelligence project. This involves generating reports on empty key fields, executing Duplicate Jobs, and manually sampling records to create a data health summary for leadership approval. The cleanup must follow a strict sequence starting with deduplication, followed by populating critical fields, standardizing formats through Validation Rules, archiving inactive records, and enforcing data entry standards at the source.

Sustainable data quality requires moving beyond one-time projects by implementing automated maintenance routines. The author suggests scheduling recurring Duplicate Jobs, distributing weekly exception reports to record owners, and tracking completeness metrics on a dashboard. Once real data ownership is established and the operational layer is secured, Salesforce artificial intelligence capabilities such as lead scoring and case classification can function reliably without undermining user adoption.

Read the original at dev.to (opens in a new tab)

Worth reading?