Update Date time : Leads

I have custom dropdown field in leads form. While updating the dropdown field, I need to update another custom field which shows updated date. But the date field is not updating into database.? whether suitecrm auto update date fields?


Fields are not auto-updated by default. Can you provide some screen shots? Is the other custom field a drop down or is it purely a date field? You would need to write a before save logic hook with some logic if you needed to update a date field dependent on a value selected in a drop down field.

Ok. got it Will. I have written a logic hook like this ,

function updateQuote(&$bean, $event, $arguments) {
	global $db;
		 // before_save
		$query = "UPDATE Leads SET quote_updated_date ='".date('Y-m-d H:i:s')."' WHERE id='".$bean->id."'";
		if($db->query($query)) {
				return true;
			return false;

its returning true , but date not updated in database. Can you please review it?


Ok, its working now. I have changed the hook as after save. Whether can I identify custom dropdown field has changed or not. how can I achieve this?