
Originally Posted by
jspencer How do we make default fields required in Sugar CE 5.0a? I could do it fairly easily in 4.5.1 by editing a few key php files in the module folder, but now that everything is rearranged in 5.0 I can't figure it out (I'd rather spend my time customizing the system...)
Can someone on the Sugar staff at least point us to the files needed to edit since you haven't replied my request to make it possible using studio?
1st of all to not modify the core code which may be overwritten with an update I suggest putting module modification into m{root}/custom/modules/{module_name}
Depending on the module you would add the following array value as seen underlined to the vardefs.php file and place it in the custom modules directory
Code:
'lead_source' =>
array (
'name' => 'lead_source',
'vname' => 'LBL_LEAD_SOURCE',
'type' => 'enum',
'options'=> 'lead_source_dom',
'len' => '100',
'audited'=>true,
'comment' => 'Lead source (ex: Web, print)',
'required' => 'true',
'merge_filter' => 'enabled',
), You would then change the database to not allow null values because otherwise you'll get an error when you rebuild or repair your Sugar installation.
There are other modules such as the Accounts module which has an array at the bottom in the file field_arrays.php
'required_fields' => array('name'=>1,'account_type'=>1),
although this change did not make the field required and I am not sure why. It seems not all modules are "built the same"
Bookmarks