With SugarCRM version 4.5.0c, I had submitted a bug and posted a thread about custom fields not saving the same as regular fields (http://www.sugarcrm.com/forums/showthread.php?p=62092). Although the bug has never changed status, it does appear that some adjustments were made to the "DynameFields.php" code that actually takes care of saving custom fields. HOWEVER, there is still a problem with fields of type "date". In the code, if the date field is not set, it gets set to 'NULL", which MySQL balks at. No custom fields are saved to the DB (because there is a MySQL error) and nothing is shown in the interface to tell you what the problem is.
The solution, at this point, is to edit the "modules\DynameFields\DynamicField.php" file at/around line 225:
When this change is made, the forms with custom date fields will now save again.PHP Code:if($field['data_type'] == 'date' && (empty($this->bean->$name )|| $this->bean->$name == '1900-01-01')){
// Change by Ryan Booz. Can't set to 'NULL' - MySQL won't take it!
//
// Was: $this->bean->$name = 'NULL';
$this->bean->$name = '0000-00-00';
}
Hope this helps someone.
Ryan


LinkBack URL
About LinkBacks



Reply With Quote


Bookmarks