1 Reply Latest reply: Nov 16, 2012 10:30 AM by Moazzam RSS

    passing parameter from one form to other

    Moazzam
      I am using oracle forms 10g on Windows platform.

      My application has search form which shows results according to the searc criteria. When i double click any row on this form, then i want to open the detail form containing details of the row.

      Following code is present in WHEN-MOUSE-DOUBLECLICK even on the search form:
      Declare
           pl_id   ParamList;      
           pl_name VARCHAR2(50) := 'BRV_Voucher_List';
      Begin
            pl_id := Get_Parameter_List(pl_name);
            IF Id_Null(pl_id) THEN     
                  pl_id := Create_Parameter_List(pl_name);
                     Add_Parameter(pl_id,'TRN_CODE',TEXT_PARAMETER,'T014');                 
                     Add_Parameter(pl_id,'VOUCHER_NO',TEXT_PARAMETER,'VOUCHER_NO = ''' ||:VOUCHER.VOUCHER_NO || '''');                 
            END IF; 
            error_message(:VOUCHER.VOUCHER_NO);
           OPEN_FORM ('GL_CASH_PAYMENT_VOUCHER',ACTIVATE,SESSION,pl_id);
           --call_FORM ('GL_CASH_PAYMENT_VOUCHER',hide,no_replace,no_query_only,NO_SHARE_LIBRARY_DATA,pl_id );
           Destroy_Parameter_List(pl_id);
      End;     
      Following code is present in the detail form in the when_new_form_instance trigger to populate the details:
      IF :PARAMETER.VOUCHER_NO IS NOT NULL THEN
           information_message(:PARAMETER.VOUCHER_NO);
           SET_BLOCK_PROPERTY('RECORD_BLOCK',Default_Where,'VOUCHER_NO = ''' ||:PARAMETER.VOUCHER_NO || '');
           EXECUTE_QUERY;
      END IF;
      The problem is that the value is not being passed correctly from search to detail form. if I double click a record and voucher no. is 10, then it is passed correctly, and detail form show the correct voucher_no. However, when for the second time i double click someother record e.g. with voucher_no = 20, then the detail form still shows the voucher_no 10. Please help.
        • 1. Re: passing parameter from one form to other
          Moazzam
          The problem is solved. Actually the problem was in the search form's when-mouse-doubleclick event. Following code fixed the issue:
          Declare
               pl_id   ParamList;      
               pl_name VARCHAR2(50) := 'BRV_Voucher_List';
          Begin
                pl_id := Get_Parameter_List(pl_name);
                IF NOT Id_Null(pl_id) THEN
                          Destroy_Parameter_List(pl_id);
                END IF;     
          
             pl_id := Create_Parameter_List(pl_name);
                Add_Parameter(pl_id,'TRN_CODE',TEXT_PARAMETER,'T014');                 
                Add_Parameter(pl_id,'VOUCHER_NO',TEXT_PARAMETER,'VOUCHER_NO = ''' ||:VOUCHER.VOUCHER_NO || '''');                 
                OPEN_FORM ('GL_CASH_PAYMENT_VOUCHER',ACTIVATE,SESSION,pl_id);
          End;     
          Thanks for yours time.