Simplest solution is to use Enhanced Studio to create it as salesagility suggested.
Or you can create a vardefs extension to define a new field by simply creating two small files.
To create an extension, just create two new files: one for the field vardefs definition under <sugar_root>/custom/Extension/modules/Opportunities/Ext/Vardefs like custom.php and one for the label definition under <sugar_root>/custom/Extension/modules/Opportunities/Ext/Language like en_us.custom.lang.php
For example, the contents below define the field 'note_date' in my Notes module:
PHP Code:
<?php
$dictionary['Note']['fields']['note_date'] = array(
'required' => '1',
'name' => 'note_date',
'alias' => 'hist_date',
'vname' => 'LBL_NOTE_DATE',
'type' => 'datetime',
'massupdate' => '0',
'importable' => 'true',
'reportable' => '1'
);
?>
You should change the first array element from 'Note' to 'Opportunity'. You should also change the name to what you want and the vname to the name of a label (which also must be defined). You can change any of the other array elements like 'required' or 'reportable' to what you want.
The label file would contain something like:
PHP Code:
<?php
$mod_strings[ 'LBL_NOTE_DATE'] => 'Activity Date';
?>
When you finish the file, go to Admin and do a Quick Repair and Rebuild and you'll have your new field.
Phil
Bookmarks