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

Hello,
When we look for duplicates of a specific contact, we can choose different fields to look for duplicates, but not the Last Name field.
I’ve tried to change something in the Contact fields in Studio, but if I enable “Duplicate Merge”, it doesn’t change anything, and I noticed that it’s not enabled in the field “First Name”, which is the first field proposed when looking for duplicates.
When I click on the ?, I see that when enabled, the field will appear in the Merge Duplicates features, but will not be available to use for the filter conditions in the Find Duplicates feature (see picture).

Is there any other way to make this field appear in the Find Duplicates feature?
Thanks for your help,
Kind regards,
Regine

Hey Regine,
This functionality does not exist in the CRM by default but you can do this:

If you go to: /custom/Extension/modules/Contacts/Ext/Vardefs/ and open vardefs.php. If vardefs.php does not exist then create it.

Inside this file, type:

$dictionary['Contacts']['fields']['last_name']['merge_filter'] = 'enabled';

and then do a Quick Repair/Rebuild.

1 Like

Thanks a lot John, I’ll try and let you know if it works!
Kind regards,
Regine

Hi John,
Sorry but it didn’t work…
Do you have any other idea?
Thanks,
Kind regards,
Regine

No other idea? Maybe the IT guy made a mistake with the code you suggested? But he must have double-checked it when I told him it didn’t work…
I’d appreciate any help…
Thanks!
Regine

Hi,

As far as I can see, this would be how you would do this through the code. Have you ensured that you have run a Quick Repair & Rebuild and Cleared your browser’s cache, to ensure you can see the changes.

If it still doesn’t work, what SuiteCRM Version are you on?
It may be worth upgrading to v7.3.1.
In 7.3.1, The Last name field seems to show by default when Looking for Duplicate Contacts, as I have not made these modifications on my test 7.3.1 version, but the “Last name” field shows.

I followed the instructions of John and this works for me.
I would like to know if there is a way to prevent a contact is created if a custom field has the same value in an existing contact.
The procedure explained John, I think, you need to look for duplicates me that have already been saved. I need something that signals before saving.
Thank you

I believe you can achieve it with a BeforeSave Logic Hook.

Alternatively you could customise some javascipt/Ajax calls in your EditView.

Probably the topic has been covered either in the SuiteCRM Forum or in one of the many sites about SugarCRM so if you google it you may come up with a solution.

If you do so please post it so everyone can benefit from it.

Hi amariussi, thanks for your reply.
To find a solution to prevent create duplicate values before saving I tried searching the forum but I could not find much.

What you speak of it

is not very clear for me also because I’m not very practical programming.
However I can not understand why it is necessary to change we are talking about for the custom field in the search for duplicates in management study if there are options

  • Check;
  • Merge Duplicates

I should already be doing what I got instead with the modification indicated by John.
is a software error, or have I misunderstood the function of those options?
Thanks for the support

Hi John,
I did clear the cache, ran the Quick Repair, but still can’t see the Last name in the filters of “Find Duplicates”.
We have the version 7.3, I’ll ask the IT to install the 7.3.1, hopefully it will work! :slight_smile:
Thanks for your reply!
Kind regards,
Regine

Hello again,
We’ve upgraded our version from 7.3 to 7.4, but still can’t see the “last name” field by default in the filters for duplicates in contacts.

Do you have any idea what could cause this? Something on our server? We still don’t have the possibility to edit the fields without clicking on “edit” either…
I hope you can help!
Thanks,
Kind regards,
Regine

Hi har,

It seems the line I asked you to add earlier: [i]

$dictionary['Contacts']['fields']['last_name']['merge_filter'] = 'enabled';

[/i]
Can cause this functionality to not work, Results seem to vary.

Now that you’ve upgraded to the Most recent SuiteCRM version.it may be worth removing the line above from the file it was added,
(If the File was added correctly, it should be in the location /custom/Extension/modules/Contacts/Ext/Vardefs/)
Also, if there is a file in /custom/Extension/modules/Contacts/Ext/Vardefs/ that contains last_name in the filename, check that file for the line above, if it is in there, remove it.

After removing the Line and saving the file, Run a Quick Repair & Rebuild in the CRM, Clear your Browsers Cache, CTRL+F5 on a contact’s Detailview,
This functionality should work.

In regards to inline editing, if you follow these steps:

1.) Go to Admin > System Settings
2.) Uncheck BOTH inline editing check boxes. There’s one for detail view and another for list view. (Save changes)
3.) Do a quick repair and rebuild
4.) Go back to Admin > System Settings
5.) Re-Check both inline editing check boxes. (Save Changes)

You should be able to use inline editing.
It may be worth keeping in mind that, although you will be able to use Inline editing on both themes, it works better on the SuiteR theme.

Hi John,
I believe I’ve done everything you said, but with no result…
I even changed the default theme to the SuiteR, did several Quick repair and rebuild, cleared the cache, unticked both “inline” boxes, saved, closed, reopened, ticked them again, did a quick repair and rebuild again, but nothing changed.
I see that the other theme is still enabled, but is not the default one anymore. Should I disable it?
What could cause this not to work?
Thanks for your help,
Kind regards,
Regine

Hi har,

I was able to replicate the issue with the Contacts Last name not showing in the “Find Duplicates” functionality, this 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/
There should be few files here.

Check each of the files for the line:

$dictionary['Contact']['fields']['last_name']['merge_filter'] = 'enabled';

or

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

If either of these lines appear, delete it.

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”

Also, In regards to inline editing. Please ensure that you’re double-clicking the fields, as this is how you activate inline editing.

Thanks John, I’ll try that and let you know!
Kind regards,
Regine

Hello,
We’ve just installed the latest version (7.6) on a test environment, and I notice that I still can’t see “Last name” when looking for duplicates in “Contacts”…

Is there a pre-requisite in the configuration of the CRM in order to see this?
Thanks for your help,
Kind regards,
Regine

Hi Har,

I’ve just installed a fresh copy of 7.6 and can see the “last name” field when looking for duplicates out of the box.

After installing, did you modify anything regarding the Last Name field in studio?
(Such as changing the “Duplicate Merge” setting)

If i do a fresh install and don’t change that setting, I can see the “last name” field.
However, if i change that setting, The “Last name” field is no longer usable when searching for duplicates.

You may have to do as previously suggested to resolve this:
[i]
Open the SuiteCRM File Directory and navigate to: /custom/Extension/modules/Contacts/Ext/Vardefs/
There will likely be a file by the name: “sugarfield_last_name.php”

This file will likely contain the line:

$dictionary['Contact']['fields']['last_name']['merge_filter'] = 'enabled';

or

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

If either of these lines appear, delete it.
Then, save your changes.

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”
[/i]

Hopefully this helps resolve the issue!

Hi John,
Thanks for your reply.
I didn’t change anything after installing the version 7.6, that’s why I was wondering if there was some kind of pre-requisite for this…
We’re a bit short on IT staff at the moment, so I’ll have to investigate a little later about the solution you propose.
I’ll let you know when we’ve tried.
Kind regards,
Regine

Hey Regine,

did you ever get this to work? We are having a similar issue. I have actually done extensive development on SugarCRM (basically the same code) and have seen this work, but haven’t gotten it to work in SuiteCRM.

-Brian

Hello Brian,
I’m afraid we still haven’t solved that issue, and certainly won’t before some time.
If you find a solution on your side, please share it with us, thanks!
Kind regards,
Regine