add duplicate email column to duplicate check on lead save

When saving a new lead and there is another lead with the same email, i get the Duplicate screen, with a table of the leads that have the same email. but the email column is not shown - only the first name, last name and title and the headline doesn't tell that the duplicate is an email , only that there are duplicates.

how can i show the email column in the duplicates table?

working with sugarcrm CE 6.5.24 and  code change doesn't have to be upgrade safe.

Parents
  • Hi Asaf Army,

    I do not have a complete process available for you, but I took a look at stock CE 6.5.24 files.

    It appears that the fields in that list derive at least in part from the following file:

    modules/Leads/views/view.showduplicates.php

     

    This file contains the following database query:

    $query = 'SELECT id, first_name, last_name, title FROM leads WHERE deleted=0 ';

     

    Changing the displayed fields might include needing to change this database query. It might require other changes as well.

     

    I am not a CE user so I am not sure how the email address field work in CE, but I know in subscription editions (Pro, Ent, etc) the email address functions more like a related module with it own table and relationship tables. A manual rewrite of the above query for use in a subscription edition might look something like the following:

    $query = 'SELECT leads.id, leads.first_name, leads.last_name, leads.title, email_addresses.email_address FROM leads 
    JOIN email_addr_bean_rel ON leads.id = email_addr_bean_rel.bean_id
    JOIN email_addresses ON email_addr_bean_rel.email_address_id = email_addresses.id
    WHERE leads.deleted=0 '
    ;

    This query might be entirely irrelevant to solving this same use case in a subscription edition. The query is just being shown here as a query that would work in a subscription edition's database to get the information including email address, regardless of use case.

    I hope this helps in your investigation of how to achieve your goal.

Reply
  • Hi Asaf Army,

    I do not have a complete process available for you, but I took a look at stock CE 6.5.24 files.

    It appears that the fields in that list derive at least in part from the following file:

    modules/Leads/views/view.showduplicates.php

     

    This file contains the following database query:

    $query = 'SELECT id, first_name, last_name, title FROM leads WHERE deleted=0 ';

     

    Changing the displayed fields might include needing to change this database query. It might require other changes as well.

     

    I am not a CE user so I am not sure how the email address field work in CE, but I know in subscription editions (Pro, Ent, etc) the email address functions more like a related module with it own table and relationship tables. A manual rewrite of the above query for use in a subscription edition might look something like the following:

    $query = 'SELECT leads.id, leads.first_name, leads.last_name, leads.title, email_addresses.email_address FROM leads 
    JOIN email_addr_bean_rel ON leads.id = email_addr_bean_rel.bean_id
    JOIN email_addresses ON email_addr_bean_rel.email_address_id = email_addresses.id
    WHERE leads.deleted=0 '
    ;

    This query might be entirely irrelevant to solving this same use case in a subscription edition. The query is just being shown here as a query that would work in a subscription edition's database to get the information including email address, regardless of use case.

    I hope this helps in your investigation of how to achieve your goal.

Children
No Data