Forms 3.0 Question

From: Dewald Pretorius <dewald.pretorius_at_digitec.co.za>
Date: 24 Nov 93 19:49:00 GMT
Message-ID: <2693.208.uupcb_at_digitec.co.za>


CM> If table2, then when we commit the changes to table3 how do we avoid
CM> getting an error that there are no rows to commit? If table 3, then
CM> how do we get the all of the values of b to fill in.

If I understand you correctly, here is what I would suggest:

Create two blocks: The first will be a non-base table, single-row block (BLOCK_A), containing only a screen field (scr_a) for the user to enter a value (corresponding to a column on table "a"). The second table will be a multi-row base-table block (BLOCK_B) containing records on table "b" related to the value entered in "BLOCK_A.scr_a". Create a third field field (this will be a screen field) called "scr_c" in block "BLOCK_B". (NOTE: Remember that field "a" in "BLOCK_B" must be on page 0).

KEY-NXTFLD (on field :BLOCK_A.scr_a)
/* validate field :BLOCK_A.scr_a against table "a" */ go_block ('BLOCK_B');
execute_query;

At this stage all the records in block "BLOCK_B" will be displayed for the entered value of :BLOCK_A.scr_a. Now, (I assume) the user enters values for :BLOCK_B.scr_c (for every record in "BLOCK_B".

The KEY-COMMIT trigger will then look like this.

KEY-COMMIT
first_record;
WHILE :system.last_record != 'TRUE'
LOOP
IF :BLOCK_B.scr_c is not null then
insert into c values (:BLOCK_B.b, :BLOCK_B.scr_c); END IF;
down;
END LOOP;
:system.message_level := 5;
 commit;
:system.message_level := 0;

  • Greetings. Dewald Pretorius Fax: +27-11-3135122
  • Internet: dewald.pretorius_at_digitec.co.za Tel: +27-11-3135227
  • RM 1.2 01163 * Modular Sofas. Only $299.00. For rest or fore play.
  • Digitec Online - 10 Nodes - Johannesburg - South Africa - +27-11-476-7136 -
  • _at_digitec.co.za - ILink - Weather - BASNet - RsaNET -
Received on Wed Nov 24 1993 - 20:49:00 CET

Original text of this message