I have several tables in a master-child relationship, the master table bio, while several child table treatment,....etc Here in this example I will like to work with one child, linked to the master table via a key field named reg_id.
The master table contains two fields showing when was the last update and by whom; last_update. and last_upd_by.
I have no trouble to update the master table when the save button related to the master button is saved.
I am also trying to update (the last update) field in the master table, when changes are made in the child tables. i.e treatment tables. (child)
I have put these code inside before record update OR custom record update but both show similar result!
$record = $pageObject->getMasterPage();
$keys = $record["reg_id"];
$data = array();
$data["last_update"]=now();
$data["last_upd_by"]=$_SESSION["UserID"];
DB::Update("bio", $data, $keys);
The whole table's [last_update] and [last_upd_by] fields gets changed.
The same thing happens when I chaged getMasterPage() to getCurrentRecord()
I just want to update the specific master record no the whole table.
Where did I go wrong. Thank you for pointing out.
Z