How can I add a field to the fields proposed when looking for duplicates?

Hey Regine,

I will definitely keep you posted as I will definitely need to get this to work. So… here are some updates:

  1. I was just trying to do an import on the ā€œaccountsā€ module and sure enough, ā€œnameā€ was one of the available fields that could be added to the merge duplicates fields during import. this tells me that at least the code to handle all this isn’t something that was present in Sugar Pro/Enterprise but not in Sugar CE.

  2. I spent some time looking at the ā€œvardefā€ files in the back end and it looks like when i check the ā€œmerge dupliucateā€ checkbox during field definition in module builder, at least one correct value is being set in /custom/modulebuilder/builds//SugarModules/modules/<PACKAGE_PREFIX>_<MODULE_NAME>/vardefs.php (please forgive if the path isn’t perfect, it just gets reallly hairy in Sugar/Suite’s highly overconvoluted dir structure).

I can see this at:

nrgcsadmin@NRGCSVMLCRMWT03:~/SuiteCRM/custom/modulebuilder/builds$ grep -ir ā€œmergeā€ * | grep -i org
Organizations/SugarModules/modules/ORG_Organizations/vardefs.php: ā€˜duplicate_merge’=>true,
Organizations/SugarModules/modules/ORG_Organizations/vardefs.php: ā€˜duplicate_merge’ => ā€˜enabled’,
Organizations/SugarModules/modules/ORG_Organizations/vardefs.php: ā€˜merge_filter’ => ā€˜disabled’,
Organizations/SugarModules/modules/ORG_Organizations/vardefs.php: ā€˜duplicate_merge_dom_value’ => ā€˜1’,
nrgcsadmin@NRGCSVMLCRMWT03:~/SuiteCRM/custom/modulebuilder/builds$

  1. However, after deploying the package, I can’t find anythng regarding ā€œduplicate mergeā€ in any of the files that get created in the cusom/modules and custom/extensions dir.

a grep in the custom/modules dir yields the following (which i expeced since i found ā€œnameā€ in the accounts merge duplicate starge of the import process. NOTICE that my custom module ā€œOrganizationsā€ doesn’t show up here (and yes I just redeployed and did a repair/rebuild to make sure that support won’t simply give me their BS general response to every question about this software) :

nrgcsadmin@NRGCSVMLCRMWT03:~/SuiteCRM/custom/modulebuilder/builds$ grep -ir ā€œmergeā€ * | grep -i org
Organizations/SugarModules/modules/ORG_Organizations/vardefs.php: ā€˜duplicate_merge’=>true,
Organizations/SugarModules/modules/ORG_Organizations/vardefs.php: ā€˜duplicate_merge’ => ā€˜enabled’,
Organizations/SugarModules/modules/ORG_Organizations/vardefs.php: ā€˜merge_filter’ => ā€˜disabled’,
Organizations/SugarModules/modules/ORG_Organizations/vardefs.php: ā€˜duplicate_merge_dom_value’ => ā€˜1’,
nrgcsadmin@NRGCSVMLCRMWT03:~/SuiteCRM/custom/modulebuilder/builds$ ^C
nrgcsadmin@NRGCSVMLCRMWT03:~/SuiteCRM/custom/modulebuilder/builds$ cd ~/SuiteCRM/custom/modules
nrgcsadmin@NRGCSVMLCRMWT03:~/SuiteCRM/custom/modules$ grep -ir ā€œmergeā€ * | grep -i org
nrgcsadmin@NRGCSVMLCRMWT03:~/SuiteCRM/custom/modules$ cd …/Extension
nrgcsadmin@NRGCSVMLCRMWT03:~/SuiteCRM/custom/Extension$ cd …/Extension
nrgcsadmin@NRGCSVMLCRMWT03:~/SuiteCRM/custom/Extension$ grep -ir ā€œmergeā€ * | grep -i org
nrgcsadmin@NRGCSVMLCRMWT03:~/SuiteCRM/custom/Extension$

  1. QUICK QUESTION…
    how did you get to the screen that you posted in previous message in this thread? my ā€œde-duplicateā€ screen looks a little different, no matter whether i access it via the import wizard in the admin menu or the import link at the top of the list-view for a module (see attached image).

-Brian

Hi Brian,
Thanks a lot for the update, I appreciate!
For the image I posted first, it comes from the action ā€œFind Duplicatesā€ that you can select when on a Contact.

That’s where we’d like to see ā€œLast nameā€, but even if ā€œDuplicate Mergeā€ is enabled for Last Name in the Studio, it doesn’t appear in the fields we can select to find duplicates…

I’ll let you know if we find something…
Cheers,
Regine

Hello har,

I’ve just read the entire thread, and it worked for me. By default, ā€œfind duplicatesā€ on a Contact will add both first_name and last_name as the search criteria.

Have you tested this on a fresh installation? I’m using 7.6.3 now.

Regards, Celso.

i’m on 7.6.4. and you are right, i’m able to do this for standard modules (i.e. accounts, contacts). it’s the custom modules for which I can’t ge this to work. i edit a field in the module and enable duplicate merge on that field. i deploy the newly editted module. then try to import and on the screen where you select duplicate merge criteria, the field doesn’t show up.

Thanks for your replies.
I’m on Suite CRM Version 7.4, Sugar Version 6.5.20 (Build 1001), and it’s supposed to be active with that version as well, but it isn’t in my case.
I’ll see if we can install the version 7.6.
Kind regards,
Regine

I was experiencing the same problem.
inspired from john comment here is how I resolved it:

Navigate to Admin > Studio > Contacts > Fields, and select the ā€œlast_nameā€ field
If ā€œDuplicate Mergeā€ is enabled, disable it.

Then, Open the SuiteCRM Directory and navigate to: /custom/Extension/modules/Contacts/Ext/Vardefs/
I found 2 files ā€œsugarfield_last_name.phpā€ and ā€œsugarfield_first_name.phpā€
from sugarfield_last_name.php
I removed the line

"$dictionary['Contact']['fields']['last_name']['merge_filter']='disabled';"

from sugarfield_first_name.php I removed (note the last 2 lines) :

$dictionary['Contact']['fields']['first_name']['merge_filter']='disabled';
$dictionary['Contact']['fields']['first_name']['duplicate_merge']='disabled';
$dictionary['Contact']['fields']['first_name']['duplicate_merge_dom_value']='0';

Go back into the CRM, run a Quick Repair and Rebuild, Clear your browser’s cache.
If the line above is no longer in the CRM’s files, the last name field should be usable in ā€œFind Duplicatesā€

This is how I solved my problem! :slight_smile:

1 Like

Thanks bmwtourer that works great!

Anybody know how to add the email-address to the default filters shown? (normally it’s just first name and last name that are shown)

It’s a lot faster to remove a filter than add a filter, so I’d rather have all three show by default…

Hello John,

To define the email address in the merge fields list (edit /custom/Extension/modules/Contacts/Ext/Vardefs/sugarfield_email1.php)
$dictionary['Contact']['fields']['email1']['merge_filter']='selected';

if you just want it on the available fields list for merging
$dictionary['Contact']['fields']['email1']['merge_filter']='enabled';

After nearly 6 years, is there still no way to do this through the CRM system itself?
Is there a request feature system in place that we could request this?
I would prefer not to make edits outside of the web interface itself.