Hi dvelguru,
You can't add a datetime field through studio, but you can add it as an extension.
I added a datetime field called note_date to the Notes module so that I could set the date something occurred as distinct from the date the record was created or modified.
To do this I added a new file with the path:
<sugarcrm>/custom/Extension/modules/Notes/Ext/Vardefs/custom_fields.php
whose entire contents is:
PHP Code:
<?php
$dictionary['Note']['fields']['note_date'] = array(
'required' => '1',
'name' => 'note_date',
'alias' => 'hist_date',
'vname' => 'LBL_NOTE_DATE',
'type' => 'datetime',
'default' => date("m/d/Y H:i"),
'massupdate' => '0',
'importable' => 'true',
'reportable' => '1'
);
?>
The name of the file does not matter. Do a repair and the new field appears in the main notes table (not notes_cstm). You can then add it to layouts, etc through Studio.
The only additional problem was that the time inputs would not appear in the QuickCreate layout when I added my note_date field to Quick Create layout through Studio. To fix this I had to define the type in <sugarcrm>/custom/modules/metadata/quickcreatedefs.php with the line:
'type' => 'datetimecombo',
Phil
Bookmarks