Thanks for the reply Kuske. Well, actually... I think I made it work. I'm using v5.2 CE. I was researching the forum posts and ran across a couple of interesting post. One showed how to set the date entered and date modified as importable.
Extension - Custom Vardef
/custom/Extension/modules/Leads/Ext/Vardefs/update_entered_vardefs.php
PHP Code:
<?php
$dictionary['Lead']['fields']['date_entered']['importable'] = true;
$dictionary['Lead']['fields']['date_modified']['importable'] = true;
?>
Then, using a "before_save" logic hook you can set the value. The second post I found. pointed out the user date format perferences. It requires some date/time traslations, but it can be done. See code below. PHP Code:
function updateDateEntered(&$bean, $event, $arguments) {
global $current_user, $sugar_config;
$udf = $current_user->getPreference('datef');
if ($udf == "") {
$udf = $sugar_config['default_date_format'];
}
// Update the date_entered field based on entered_override_c field.
if (!empty($bean->entered_override_c)) {
$bean->date_entered = gmdate("Y-m-d", strtotime($bean->entered_override_c))." 16:11:11";
$bean->entered_override_c = '';
} // if not empty
} // end of updateDateEntered
I'm not sure if the custom vardef is needed, but it will help with my imports in the future. I'm also not sure if this creates any serious security issues. Even if it does, it's only leads.
This way will also allow you to audit the fields to see who makes changes.
Cheers,
Jeff Walters
Bookmarks