Hi, I am trying to create custom validation check with email and country for creating new Lead and Accounts.
I have a custom field called “CustomCountry”.
I want to allow creation of new lead and accounts only when this condition is satisfied.
Validation Conditions
------------------------------------------------------------
Email : compulsory
CustomCountry : compulsory
same email and same country : Not Allowed
same email and diff country : Allowed
------------------------------------------------------------
I did go through https://docs.espocrm.com/development/duplicate-check/ .
created the file custom/Espo/Custom/Classes/DuplicateWhereBuilders/Lead.php .
But any breakpoint on this file is never hit while creating .
I went and set breakpoint at \htdocs\espocrm\application\Espo\Modules\Crm\Servi ces\Lead.php on function afterCreateEntity() .
But this get hits after “The record you are creating might already exist” dialog box is appeared and “Create” is clicked.
I would like this dialog box to only appear when validation Conditions are met.
Please let me know how to approach it.
much thanks,
I have a custom field called “CustomCountry”.
I want to allow creation of new lead and accounts only when this condition is satisfied.
Validation Conditions
------------------------------------------------------------
Email : compulsory
CustomCountry : compulsory
same email and same country : Not Allowed
same email and diff country : Allowed
------------------------------------------------------------
I did go through https://docs.espocrm.com/development/duplicate-check/ .
created the file custom/Espo/Custom/Classes/DuplicateWhereBuilders/Lead.php .
But any breakpoint on this file is never hit while creating .
I went and set breakpoint at \htdocs\espocrm\application\Espo\Modules\Crm\Servi ces\Lead.php on function afterCreateEntity() .
But this get hits after “The record you are creating might already exist” dialog box is appeared and “Create” is clicked.
I would like this dialog box to only appear when validation Conditions are met.
Please let me know how to approach it.
much thanks,
Comment