trigger question
Posted: Fri May 16, 2008 12:41 pm
Hi Steve
can I use the method : after_action_edit() in dataface-0.7.1 ?
when I try the following:
function after_action_edit(&$record){
//comment
}
I get this error:
Warning: Missing argument 1 for tables_neu_fragen::after_action_edit() in /path/to/website/dataface-0.7.1/partner/tables/neu_fragen/neu_fragen.php on line 17
or does the method refer to $record automatically?
I have do do some calculations when the record has been edited and update some fields depending on these calculations.
my first try looks like this:
---------------------snip----------------------------------
function after_action_edit(&$record){
//calculate the difference
$auth =& Dataface_AuthenticationTool::getInstance();
$groesse_sch = $record->val('schuhgroesse');
$fussgroesse_re = $record->val('fussgroesse_re');
$mod_re = $record->val('mod_re');
if ($groesse_sch - (($fussgroesse_re*3)) <0>setValue('mod_re', $mod_re_neu);}
}
---------------------snap------------------------------------
maybe you'll find the time to provide a simple example of the after_action_edit method
I still hesitate to upgrade to the last xataface release because i made some changes to the dataface core, and unfortunately i forgot to document it....(very professional...isn't it?)
thanks
and greetings from Berlin
Martin