I add below code to update the master table. But It doesn’t work at all.
Please give me a guide.
$e[“on_after_update”] = array(“update_master”, null, true);
function update_master($data)
{
// you can also use grid object to execute sql, useful in non-mysql driver
global $grid;
$str = “update DPLSchedule as m
set UpCN51 = (select count(HHT) from DPLmigration as d where d.pid=m.id and d.MgStatus = ‘SUCCESS’ AND d.HHT = ‘CN51’),
UpCT40 = (select count(HHT) from DPLmigration as d where d.pid=m.id and d.MgStatus = ‘SUCCESS’ AND d.HHT = ‘CT40’)
where m.id = {$data[“pid”]}”;
$grid->execute_query($str);
}
Please share complete code for review. This code segment does not show any issue.
You can either email me or share link by uploading code here: https://gist.github.com/
Thank you. I’ve changed my mind not to use this function. I am going to use the custom button on the toolbar with the user-defined function. But I don’t know how to do that.
I added new button to the top toolbar. But I can’t call my function when the button is pressed. That is why I asked you How to add the user defined button at the top toolbar.