How to update a custome field in database.

Hi All,

I have created an custom field converteddate_c for leads. I want to be update it when I goes to convert lead.
I am unable to understand from where I can update it from php code.

please help me.



I’m not sure to have completely understand what you want to do. But i think this would be done in modules/Leads/views/view.convertlead.php or in the controller.php.

Hope that help.

Best regards.

I have a custom column converteddate_c in leads_cstm table. I want to update it with current datetime when user will click on convert leads from backend.

Ok, then this would be done in modules/Leads/views/view.convertlead.php in the display function I think.

In display function I am writing update code it’s making page blanck.

$query_cstm = “UPDATE leads_cstm set converteddate_c=$date_time where id=$_REQUEST[‘record’]”;

Yes it’s normal you call something which doesn’t exist. You need to declare the $db variable in global. Like this:
global $beanList, $db;
$query_cstm = “UPDATE leads_cstm set converteddate_c=$date_time where id=$_REQUEST”;

But I think this is better to see how they update a field in display function (certainly something like this:$filter .= ‘&name_advanced=’ . urlencode($this->focus->account_name); ) and use the same way as them than using a database request.

When you have a problem like this, look at your log files, this can be very helpful .

Thanks sky54000