AnsweredAssumed Answered

How to add Email field as duplicate check in Contacts module on Lead Conversion Process?

Question asked by Nagamani D on Mar 9, 2020
Latest reply on Mar 16, 2020 by Poojitha Katram

Hi Everyone,

 

We had a requirement in Lead Conversion Process in SugarCRM 9.x . We are working on 9.x Sugar Professional  Edition. Basically when we convert the Lead on Convert page of Contacts module by default first name and last name will be as default check in Contacts Page. Now I would like to check based on the Email field entered in the Leads module. I have tried extending the vardefs.ext.php from Contacts module to custom path and tried. But when I tried to  do this I am getting an error on Lead Conversion like "Unable to Convert Lead" error . I clearly understood that my custom code is breaking the Default functionality and  I tried removing the code and changed a bit and retried giving repair and rebuild. But due to some mistake in my code second time I am not able to open the instance also. Can someone try helping me to figure out the error and resolve the issue. I dont see any errors logged in sugarcrm.log or error.log.

 

This is code I have added in the custom/Extension/modules/Contacts/Ext/Vardefs/duplicate_check_email.php

 

 

<?php

$dictionary['Contact'] = array(

'duplicate_check' => array(
'enabled' => true,
'FilterDuplicateCheck' => array(
'filter_template' => array(
'$or' => array(
array(
'$and' => array(
array('first_name' => array('$starts' => '$first_name')),
array('last_name' => array('$starts' => '$last_name')),
array('accounts.id' => array('$equals' => '$account_id')),
array('dnb_principal_id' => array('$equals' => '$dnb_principal_id')),
)
),
array('email1' => array('$starts' => '$email1')),
)
),
'ranking_fields' => array(
array(
'in_field_name' => 'account_id',
'dupe_field_name' => 'account_id',
),
array(
'in_field_name' => 'last_name',
'dupe_field_name' => 'last_name',
),
array(
'in_field_name' => 'first_name',
'dupe_field_name' => 'first_name',
),
),
),
),
);
?>

Could anyone suggest how to resolve the issue and add email as duplicate check in Contacts Page on Lead Conversion process in Sugar 9.x Professsional Edition. Thanks in Advance.

Outcomes