commit twice in one trigger [message #81994] |
Tue, 08 April 2003 08:48 |
kim
Messages: 116 Registered: December 2001
|
Senior Member |
|
|
hello,
i have a form with two blocks that need to be committed. the problem is that the data to be inserted into the second block depends on the data from the first. the first block shows ten records which the user then updates. the second block has a field that contains the sum of these ten records. to get the sum and commit into the second block, the person who coded this tried the following in a commit button:
do_key('commit_form');
get_total_hours;
do_key('commit_form');
his reasoning was that the first block is committed on the first do_key, the following procedure uses SQL to get the sum from the first block's table and then inserts this info into the second block, and then the form is committed again, this time committing a record to the second block as well. this does not work... only the first ten records are committed to the first table, and the record that is supposed to be inserted into the second table is not. can someone tell me how to change this so that all 11 records are committed... hope that made sense! thanks.
|
|
|
Re: commit twice in one trigger [message #82012 is a reply to message #81994] |
Thu, 10 April 2003 02:05 |
Zaire
Messages: 36 Registered: October 2002
|
Member |
|
|
Most of the time a block will not commit is when its status is QUERY or NEW. Make sure that the total is being assigned to the blocks base table item i.e. a column that is on the table. Commit_Form will commit whatever changes is made on the form. If an UPDATE was issued, try simply using COMMIT rather than DO_KEY('COMMIT_FORM');
|
|
|
|