Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SugarCRM: How do I make "first name" and "salutation" required fields on the "Convert Lead to Contact" form?

Tags:

sugarcrm

We use a customized installation of SugarCRM and I need to make a change to the "Convert Lead to Contact" form. On the form, only "last name" is marked as required, but if the user does not enter a salutation or first name, Sugar will throw an SQL error on the insert (because salutation and first name are required fields for contacts).

I've tried adding this line to "modules/Contacts/metadata/editviewdefs.php" and "modules/Contacts/metadata/quickcreatedefs.php":

array (
'name' => 'first_name',
'displayParams'=>array('required'=>true),
)

I'm trying other modifications but I can't find anything online yet on this exact problem. I will update this question with my findings. Thanks!

Update: Added "first_name" and "salutation" to the 'required_fields' array in "modules/Contacts/field_arrays.php", did not help.

Update: This is on SugarCRM 5.1. This work is happening during the upgrade to 5.1.

Update: Added the following line to "modules/Contacts/vardefs.php" the "email_and_name1" array, did not help.

'required' => 'true',
like image 969
Ed Schwehm Avatar asked Dec 04 '25 08:12

Ed Schwehm


1 Answers

The above didn't work for me. I am using 5.2.0.

What worked for me was to edit custom/modules/{modulename}/metadata/editviewdefs.php and add:

'name' => 'first_name', 'displayParams' => array ( 'required' => true, ),

Then quick repair/rebuild.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!