Rajesh123
Rajesh123

Reputation: 107

how display automated data on the display items in oracle forms

I have a code in the ADD Button , for displaying stored data(in the table) on the CONTROL Block the below code is working fine but i am not getting serial_no on the Block

COMMIT_FORM;

Declare 
  Cursor Cur_BILL_DETAILS 
   Is Select code , item_name , qty ,  amount
        From APPS.XXC_BILL_DETAILS 
       Where Bill_no = :bill_no; 
Begin 
  Go_Block('CONTROL');                 
  Open Cur_BILL_DETAILS; 
  Loop 
    Fetch Cur_BILL_DETAILS Into  :CONTROL.CODE , 
                                 :CONTROL.item_name , 
                                 :CONTROL.qty , 
                                 :CONTROL.amount; 
    Exit When Cur_BILL_DETAILS %Notfound; 
    Next_Record; 
  End Loop; 
  Close Cur_BILL_DETAILS; 
 First_Record; 
End;

And i created the pre-insert on the CONTROL Block(non-database) as below for displaying Serial_no as

declare
  v_no number;
Begin
 select xxc_sno.nextval into v_no from dual;
 :CONTROL.SNO:=v_no;
end;

Suppose ,

I am inserting into code, item_name,qty,amount and commited the record , the above ADD Button code worked fine.

The Pre-insert code not generating and displaying the no's as 1,2,3..

Ex:

  Code    item   qty  Amount 
  ----    ----   ---  -----
   A       AA     1   10
   B       BB     1   20

and click on the ADD Button, it is saved the inserted 2 records and goes the below(next , control block), display the Stored Records on the Control Block

     Sno     Code    item   qty  Amount 
     ----    ----    ----   ---  -----
      1         A      AA     1   10
      2         B      BB     1   20

But the pre-insert trigger is not generating serial no's as 1,2 ,3 etc..(not effecting)

Can you please help me?

Thanks

Upvotes: 0

Views: 5314

Answers (1)

Tony Andrews
Tony Andrews

Reputation: 132570

Forms PRE-INSERT triggers fire during the posting of data to a base table block. A control block does not have a base table so PRE-INSERT will never fire. I am not sure (my Forms knowledge is rusty) but you may want to look at using a WHEN-NEW-RECORD-INSTANCE trigger instead.

Upvotes: 1

Related Questions