Hi Letrium,
Please corret me if I'm wrong, but I don't see the original post mentioned something about for "fields that not defined in vardefs".
Anyway, you are correct, my previous post was not complete, I left two points behind (I copied it from my manual book I created for my engineers), below are the two points I left behind previously.
If the field you want to change is not in vardefs.php, please make sure whether or not your module had been changed, since the location of the file you will work on are different. Then follow the steps below,
A. CUSTOMIZED MODULE
1. Open 'custom\modules\<module_name>\metadata\editviewdef s.php
2. Look for the field you want to change, insert " 'displayParams'=>array('required'=>true), "
For example:
If you want to change "Refered By" field in "Leads" module, go to 'custom\modules\<module_name>\metadata\editviewdef s.php'
Look for 'refered_by' field, you would see:
Code:
array (
'name' => 'refered_by',
'label' => 'LBL_REFERED_BY',
),
insert " 'displayParams'=>array('required'=>true), "
Code:
array (
'name' => 'refered_by',
'displayParams'=>array('required'=>true)
'label' => 'LBL_REFERED_BY',
), 3. Admin -> Quick Repair and Rebuild
And there you go, you have yourself a new "required" field.
B. UNCUSTOMIZED MODULE
If the field you want to change is not in vardef.php, and you haven't modified/customized the outlook of the module you want to change, you won't have 'custom\modules\<module_name>' directory. Then you need to change the original editviewdefs.php file located in 'modules\<module_name>\metadata'.
1. Open 'modules\<module_name>\metadata\editviewdefs.php
2. Look for the field you want to change, change the code with " array('name'=>'field_name', 'displayParams'=>array('required'=>true))),"
For example:
If you want to change "Office Phone" field in the unmodified "Contacts" module, go to 'modules\Contacts\metadata\editviewdefs.php'
Look for 'phone_work' field, you would see:
Code:
array (
array (
'name' => 'first_name',
'customCode' => '{html_options name="salutation" options=$fields.salutation.options selected=$fields.salutation.value} <input name="first_name" size="25" maxlength="25" type="text" value="{$fields.first_name.value}">',
),
'phone_work',
), Change it to:
Code:
array (
array (
'name' => 'first_name',
'customCode' => '{html_options name="salutation" options=$fields.salutation.options selected=$fields.salutation.value} <input name="first_name" size="25" maxlength="25" type="text" value="{$fields.first_name.value}">',
),
array('name'=>'phone_work', 'displayParams'=>array('required'=>true)),
), 3. Admin -> Quick Repair and Rebuild
And there you go, you have yourself a new "required" field.
Thanks for reminding me Letrium, otherwise my first post would probably add more headache to Imrankha...
Imrankha, good luck
Bookmarks