Duplicate record check in SuiteCRM 8?

How is the duplicate record check supposed to work in SuiteCRM 8? From suitecrm 7 if I created a duplicate record I’d get a warning to either merge or create a new one. In suitecrm 8 when I create a duplicate lead, it just creates the lead, but I notice all the sidebar history is from the “old” lead that has the same email address? This seems odd?

Does the duplicate check feature need to be turned on? Or does it only work on conversion? Or does it only work with contacts? I’m not sure what the expected behavior is on SuiteCRM 8.

Yes, I saw that in ACTIONS dropdown, we have find duplicate option for v8.9.3.

Maybe we need to turn on scheduler, could you please check that?

Its not a scheduled action as far as I know. You can kick it out manually from the actions menu. In SuiteCRM 7 on conversion it would go through a duplicate check. I can’t remember though if it did that on all record creation ie: leads, and if it does this in SuiteCRM 8 the same way.

I guess I will develop a plugin to resolve for this problem :wink:

Hey @nhat.thieu there are a bunch of plugins that do this to varying degrees in the store. I was looking more for what it the actual behavior of the built in duplicate checker.

Here’s what I’ve discovered so far:

  1. Duplicate leads seem to be added without any warning or issue.
  2. Duplicate contacts seem to be added without any warning or issue.
  3. On Conversion from lead to contact I do get the duplicate checker warning.

In SuiteCRM 7 I don’t get duplicate check on leads, but do get duplicate check on Contacts and Conversion.

Is this something that needs to be “turned on” in SuiteCRM 8, or is it missing?

Hi @pstevens , Its not comfortable with v8.

Hi @pstevens
Thanks for raising this — I’ve run into the same behavior in SuiteCRM 8.

From what I’ve tested, duplicate detection isn’t really wired into the new UI yet. Unlike SuiteCRM 7, there’s no automatic warning or prevention on save, and the “Find Duplicates” action is purely manual. The odd part (as mentioned), where related activities appear linked across records with the same email can definitely be confusing and risky for data integrity.

Right now, the most reliable approaches seem to be:

Using the legacy (SuiteCRM 7) duplicate management where possible
Implementing a before_save logic hook to enforce checks (especially for email/phone)
Or using a third-party add-on for real-time validation

It would be great to know if there’s any roadmap to bring back configurable duplicate rules and real-time warnings in the SuiteCRM 8 UI, since this is pretty critical for most CRM workflows.

Curious if anyone has found a clean, UI-based solution without custom code?

hey @Rolustech do you have an example of calling the legacy duplicate check in a before save hook?

That could be useful and easily implemented until SuiteCRM 8 features catch up to SuiteCRM 7.

@pstevens Yes, you can call the legacy duplicate logic in a before_save hook in SuiteCRM 8, since the old SugarBean methods are still available under the hood.

There’s no officially supported single API for it anymore, but a simple approach is to use get_duplicates() on a fresh bean instance. For example:

$hook_array['before_save'][] = [
1,
'Check for duplicates before save',
'custom/modules/Leads/DuplicateCheckHook.php',
'DuplicateCheckHook',
'checkForDuplicates',
];
class DuplicateCheckHook {
public function checkForDuplicates($bean, $event, $arguments) {
// Only check on create (optional)
if (!empty($bean->fetched_row\['id'\])) {
return;
}

if (empty($bean->email1)) {
            return;
        }

$duplicateBean = \BeanFactory::newBean($bean->module_dir);
        $duplicateBean->email1 = $bean->email1;

if (method_exists($duplicateBean, 'get_duplicates')) {
            $duplicates = $duplicateBean->get_duplicates($bean);

if (!empty($duplicates)) {
                throw new \Exception('Duplicate record found for email: ' . $bean->email1);
            }
        }
    }
}

That said, in SuiteCRM 8 this method can be a bit inconsistent depending on vardefs and module configuration.

In practice, a lot of us are just doing a direct lookup instead (e.g. retrieve_by_string_fields on email/phone), which is more predictable and easier to control:

$existing = \BeanFactory::getBean('Leads')->retrieve_by_string_fields([
'email1' => $bean->email1,
]);

if (!empty($existing) && $existing->id !== $bean->id) {
throw new \Exception('Duplicate email detected');
}

So the legacy method works as a stopgap, but for reliability in SuiteCRM 8, a manual check is often the safer option until native features catch up.

1 Like

thank you so much @Rolustech thats super useful!

1 Like