calculated field or/and automatically calculate and print
Posted: Thu Feb 16, 2012 6:31 am
I have in my table "ttt", two fields ttt_a and ttt_b.
How can I automaticly compute a third field ttt_c to be ttt_a*ttt_b?
I tried with the functions beforeSave or after_action_edit in the file
ttt/ttt.php with the instruction :
$record->setValue('ttt_c', $record->val('ttt_a')*$record->val('ttt_b'));
But it doesn't work! ;-(
I know this third field ttt_c is not necessairy because it's calculate. Therefore is it a way in the view page, the new entry page or in the modify page to have the ttt_a*ttt_b result near the widget label? (and automatically update when ttt_a or ttt_b is changed?)
Thanks and congratulation for Xataface.
How can I automaticly compute a third field ttt_c to be ttt_a*ttt_b?
I tried with the functions beforeSave or after_action_edit in the file
ttt/ttt.php with the instruction :
$record->setValue('ttt_c', $record->val('ttt_a')*$record->val('ttt_b'));
But it doesn't work! ;-(
I know this third field ttt_c is not necessairy because it's calculate. Therefore is it a way in the view page, the new entry page or in the modify page to have the ttt_a*ttt_b result near the widget label? (and automatically update when ttt_a or ttt_b is changed?)
Thanks and congratulation for Xataface.