Lead Conversion: Add mail address to existing contact during duplicate check

Hello all,

I have a problem converting a lead into the contacts module. Initial situation: A contact "Peter Test" already exists in the account "Test Inc. This contact, however, does not have a mail address.

Now there is a request from a lead. The name is "Peter Test", he says he works for "Test Inc." and has also entered his e-mail address.

We now want to ensure that the convert process does NOT generate a new contact person, finds the existing contact person, but adds the information about the mail address to the existing contact person.

I have looked at the file under /var/www/html/sugarcrm/custom/modules/Leads/clients/base/layouts/convert-main and suspect that I need to make adjustments regarding the duplicate check, but all tests so far have resulted in crashing the system.

I am happy if you can provide tips on whether and how my plan can be implemented.

Many thanks in advance

Martin

  • When you create a new Contact during lead conversion the address should be copied over.

    However, I believe you problem is when choosing an existing Contact that does not have an address.

    if you choose an existing Contact during Lead conversion then the Contact is linked to the Lead. So don't overthink it, an after_relationship_add logic hook should do the trick.


    In the after_relationship_add on the Contact record, check to see if the Contact has an address, if not, look up the linked Lead and see if it has an address, if so, copy it to the Contact. the fact that the Contact now has an address will stop you from looping through again when you save the Contact bean.

    But I may have oversimplified your problem.

    FrancescaS

  • Hi Francesca,

    Thank you for your feedback, that helps us and we will try to implement the concept with a logic hook. This will take some time, but I will give you feedback on whether it worked as expected.

    Kind regards,

    Martin