Home » Developer & Programmer » Forms » commit twice in one trigger
commit twice in one trigger [message #81994] Tue, 08 April 2003 08:48 Go to next message
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 Go to previous messageGo to next message
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');
Re: commit twice in one trigger [message #82025 is a reply to message #81994] Fri, 11 April 2003 23:51 Go to previous message
Murali
Messages: 54
Registered: December 1999
Member
Forms which version are you using. If u are using 6i u can make use of formula column for summing up and with a single comming u can complete your task..
Previous Topic: Scrollbar position at run time
Next Topic: How to send the output of a report to excel ?
Goto Forum:
  


Current Time: Fri Mar 29 10:20:59 CDT 2024