I have another question if you allow me...
I'm trying to get a valeu from the DB, doing this:
$sql = $app->db->query("SELECT groupid FROM sys_group WHERE client_id = ".$this->dataRecord['indicou_id']);
$group = $app->db->queryOneRecord($sql);
And then update "sys_groupid" from my table "indicacao":
$app->db->query("UPDATE indicacao SET sys_groupid = ".$group." WHERE indicacao_id = ".$this->id);
These lines are in the function onAfterInsert()... and when I execute another stuff from my code in that section they are executed, but not the update above. Could you help?