Avoid Duplicate leads/accounts
  • Hi Guys

    How do you stop from duplicate leads and accounts being created.

    If we already have an account for someone, but then go to create a new lead with the same name how can we stop this happening?

    At this stage it allows us to create duplicate names.

    Any help would be appreciated, we're using 5.1.0


  • 8 Comments sorted by
  • Hi find a way


    add below code in above mentioned file (i think line near 98 or something. Here unique field is Last Name, Email, Company.

    This is working for me.

    function save_module($module)
    //echo $_request['lastname'];
    //-------------------------NEW TEST

    $lnget = $_POST['lastname'];
    $emget = $_POST['email'];
    $cmget = $_POST['company'];
    //db connection
    $username = "root";
    $password = "";
    $vtigerdb = mysql_connect('localhost', $username, $password);
    if (!$vtigerdb)
    $db_error = mysql_error();
    // cannot connect, sorry,
    print $db_error; //to see what went wrong
    if (!mysql_select_db('crmanext', $vtigerdb))
    $db_error = mysql_error();
    //cannot find database, sorry,
    print $db_error; //to see what went wrong
    $q = mysql_query("select lastname,company,email from vtiger_leaddetails");
    $lnameNew = $row['lastname'];
    $emailNew = $row['email'];
    $companyNew = $row['company'];
    echo "alert('This Lead is already exist, Please contact Administrator');";
    echo "window.location = '';";
    $request->get('leaddetails'); //error
    //echo "window.location = '';";


  • hi ozkato,

    this feature is only given for account module not for lead module.but you can use the duplicate merge feature to find the duplicates in a module and can delete the duplicates.

    you can find the documentation in the following link

    http://wiki.vtiger.com/index.php/vtiger ... te_merging
  • hi pratim,

    thanks for your reply.

    unfortunately the duplicate merge isn't going to work as we want it to tell us duplicates exist at the time of the lead being created.
  • is it possible to edit some code and make this arguments possible for the leads?
  • we have found the solution for duplicate leads.
    that will check if email id or phone or mobile is already exists in database for any of the lead.
    if that exists, it will notify the user that record already exists, also it will let you know that which user has inserted such lead.
    and, it stops duplication.

    if you are interested, i can provide the files for $10.
    contact me at mahendra@nichetechsolutions.com
  • hello nichetech

    i am interested in this solution but am wondering what method you used to solve this issue. i am not wanting to alter the code of the crm because this will lead to issues when upgrading.

    can you provide a little bit of info on your solution?

  • i wish to check the lead duplication in lead, opportunity, account when i do lead importing. otherwise, the database will have duplication in lead and accounts together....
  • we don't have the solution for the import/dedupe, however the extension below will help you keep the database clean while entering & using the data.


    vt experts
    email: support@vtexperts.com
    web: http://www.vtexperts.com
    skype: vtexperts
    phone: +1 (818) 495-5557


    *vtexperts.com is not related/part of vtiger.com team. vtiger experts is a 3rd party company providing professional vtiger services.