Duplicate check on edit record

Hello all,
I have requirement were I need to check duplicate record on edit record. currently by default suite check duplicate record only for new records.
But I want to check it on edit record also i Accounts module.

Thanks

I think that would have to be an additional validation on the Edit view.

If you search this post list for “validation” you’ll find a few solutions. The easiest ones are with simple vardefs changes, others involve injecting Javascript in to the view.

If you get it working, please share your solution here. Thanks.

Hello pgr,
I got solution for this. we need remove condition from AccountFormBase.php file. but problem is, it is core file and I don’t know how to extend this in custom/modules/Accounts.
Do you have any idea how can I achieve this?

Thanks.

Hey pgr,
I have solve this. I extend save.php file and change AccountFormBase.php path and it works. :slight_smile:

I am glad you got it working, cool! B-)

If you can please paste your code here (which files you changed, and how) this will surely help other people in the future! Thanks

You just need to copy below file

  1. modules\Accounts\AccountFormBase.php to custom\modules\Accounts\AccountFormBase.php
  2. modules\Accounts\Save.php to custom\modules\Accounts\Save.php

Next, comment below condition in AccountFormBase.php
=> Method name : handleSave()

        // if (empty($_POST['record']) && empty($_POST['dup_checked'])) {...} (Don't remove any other code from condition)

Next, change path of AccountFormBase.php in Save.php file

  require_once('modules/Accounts/AccountFormBase.php'); to require_once('custom/modules/Accounts/AccountFormBase.php');

Enjoy coding…

1 Like

Hello how did you do that?

I have same project were I need to validate if the First Name, Last Name and Mobile number are all the same . If it is duplicate there is an duplicate error message will appear

Hello bro, mine was working on add/create but not working on update