1 2 3 Previous Next 30 Replies Latest reply: Mar 25, 2013 8:04 PM by 997421 RSS

    how to pass the one form filed to second form parameter

    997421
      Hi to all,
      i get the one requirment.already one custom form ,just added the button when button button pressed a new form will opened,in that form having one filed.here logic is first form one dat block filed pass the second form parameter


      Regards,
      somasekhar
        • 1. Re: how to pass the one form filed to second form parameter
          HamidHelal
          994418 wrote:
          Hi to all,
          i get the one requirment.already one custom form ,just added the button when button button pressed a new form will opened,in that form having one filed.here logic is first form one dat block filed pass the second form parameter
          Hi, somasekhar
          You didn't mention your form version. When asking any question, always provide all related information.

          Follow the following steps...

          1. Create a parameter (i.g. VDATE) in the second form under PARAMETER node with appropriate data type.
          2. Now in the first form, take a button and write the code to open the form and pass the parameter value. For example code
          /* at When-Button-Press trigger in the button */
          declare
               ALT NUMBER;
               pl_id PARAMLIST;
          BEGIN
          
           IF :MSG_BODY IS NULL THEN
               ALT := SHOW_ALERT('N_ALERT');
               RAISE form_trigger_failure;
           ELSE
            pl_id := Get_Parameter_List('tempdata'); 
            IF NOT Id_Null(pl_id) THEN 
                 Destroy_Parameter_List(pl_id);
            END IF;
          
               pl_id := Create_Parameter_List('tmpdata');
               Add_Parameter(pl_id, 'VDATE', TEXT_PARAMETER, :BLOCK_NAME.ITEM_NAME);
               
               open_form ('second_form_name', activate, session, no_share_library_data,pl_id);
               DESTROY_PARAMETER_LIST(pl_id);
           END IF;
          END;
          Hope this works..

          Hamid


          Mark correct/helpful to help others to get right answer(s).*
          • 2. Re: how to pass the one form filed to second form parameter
            997421
            tahnks,i will try to execute this code
            • 3. Re: how to pass the one form filed to second form parameter
              997421
              my form version:6i
              ---------------------------

              once again thanks hamid giving to reply, sorry to say again same question,but here i am posted exact my requirment step by step

              1)already developed a custom form on PO_headers_all table(i.g example only)

              2)here first filed is po_header_id
              second one is vendor_id
              one more filed is authorzation_status
              here iam attaching button for authorzation_filed,the status is rejected then click on the button the new form will be opened other wise show a popup message("custom_message")
              3)for that i developed a new form with same table(same data block table)
              here iam taking PO_header_id& vendor_id fileds(display_items)

              finally my requirment is once click on he button the first form po_header_id &vendor_id filed values pass the input of the second form po_header_id &vendor_id .

              this is my exat my requirment please help me.............
              • 4. Re: how to pass the one form filed to second form parameter
                HamidHelal
                994418 wrote:
                my form version:6i
                ---------------------------

                once again thanks hamid giving to reply, sorry to say again same question,but here i am posted exact my requirment step by step

                1)already developed a custom form on PO_headers_all table(i.g example only)

                2)here first filed is po_header_id
                second one is vendor_id
                one more filed is authorzation_status
                here iam attaching button for authorzation_filed,the status is rejected then click on the button the new form will be opened other wise show a popup message("custom_message")
                3)for that i developed a new form with same table(same data block table)
                here iam taking PO_header_id& vendor_id fileds(display_items)

                finally my requirment is once click on he button the first form po_header_id &vendor_id filed values pass the input of the second form po_header_id &vendor_id .
                Hi,
                1. create two parameter in the second form under PARAMETER node with appropriate data type. (i.g. if your po_header_id &vendor_id is number parameter data type also number. Named may be P_heder_id, P_vendor_id )
                2. Create a When-New-Form-Instance trigger at second form and write this
                /* sample code require changes as your needs */
                IF :PARAMETER.P_heder_id NOT NULL and :PARAMETER.P_vendor_id NOT NULL THEN
                     SET_BLOCK_PROPERTY('YOUR_BLOCK_NAME',DEFAULT_WHERE,'COLUMN_NAME='||:PARAMETER.P_heder_id||' and second_column='||:PARAMETER.P_vendor_id);
                     EXECUTE_QUERY;
                
                END IF;
                now in your first form button create when-button-press trigger and write
                /* at When-Button-Press trigger in the button  sample code*/
                declare
                     ALT NUMBER;
                     pl_id PARAMLIST;
                BEGIN
                 
                 IF :MSG_BODY IS NULL THEN
                     ALT := SHOW_ALERT('N_ALERT');
                     RAISE form_trigger_failure;
                 ELSE
                  pl_id := Get_Parameter_List('tempdata'); 
                  IF NOT Id_Null(pl_id) THEN 
                       Destroy_Parameter_List(pl_id);
                  END IF;
                 
                     pl_id := Create_Parameter_List('tmpdata');
                     Add_Parameter(pl_id, 'P_heder_id', TEXT_PARAMETER, :po_header_id);
                        Add_Parameter(pl_id, 'P_vendor_id', TEXT_PARAMETER, :vendor_id);
                     
                     open_form ('second_form_name', activate, session, no_share_library_data,pl_id);
                     DESTROY_PARAMETER_LIST(pl_id);
                 END IF;
                END;
                Hope this works...
                • 5. Re: how to pass the one form filed to second form parameter
                  XeM
                  Hi,

                  What about Global variables, you could use as

                  :global.v_1:=yourField1;
                  :global.v_2:=yourField2;

                  When it is not needed anymore you can erase global variable like

                  erase('global.v_1');
                  erase('global.v_2');

                  Hope it would might help.
                  • 6. Re: how to pass the one form filed to second form parameter
                    HamidHelal
                    974222 wrote:
                    Hi,

                    What about Global variables, you could use as

                    :global.v_1:=yourField1;
                    :global.v_2:=yourField2;

                    When it is not needed anymore you can erase global variable like

                    erase('global.v_1');
                    erase('global.v_2');

                    Hope it would might help.
                    Why you use global variable when parameter is enough ?
                    check this http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:871067287878
                    • 7. Re: how to pass the one form filed to second form parameter
                      XeM
                      Hi Hamid,

                      You are right parameter is good as compared to global variables but i suggested as an option that he could consider, any way thanks for sharing link it is well informative
                      • 8. Re: how to pass the one form filed to second form parameter
                        997421
                        Hi hamid
                        i am trying to execute this code in when button presssed trigger(code) i get the following error messages


                        bad bind variable"msg_body"
                        bad bind variable"po_header_id"
                        bad bind variable"po_vendor_id"

                        Regards,
                        sekhar
                        • 9. Re: how to pass the one form filed to second form parameter
                          HamidHelal
                          994418 wrote:
                          Hi hamid
                          i am trying to execute this code in when button presssed trigger(code) i get the following error messages


                          bad bind variable"msg_body"
                          bad bind variable"po_header_id"
                          bad bind variable"po_vendor_id"
                          Hello, sekhar

                          What i posted is sample code. you need to modify as your need.
                          /* at When-Button-Press trigger in the button  sample code*/
                          declare
                               ALT NUMBER;
                               pl_id PARAMLIST;
                          BEGIN
                           
                          
                            pl_id := Get_Parameter_List('tempdata'); 
                            IF NOT Id_Null(pl_id) THEN 
                                 Destroy_Parameter_List(pl_id);
                            END IF;
                           
                               pl_id := Create_Parameter_List('tmpdata');
                               Add_Parameter(pl_id, 'P_heder_id', TEXT_PARAMETER, :your_column_name1); --your_column_name means what you value will pass
                                  Add_Parameter(pl_id, 'P_vendor_id', TEXT_PARAMETER, :your_column_name2);
                               
                               open_form ('second_form_name', activate, session, no_share_library_data,pl_id);
                               DESTROY_PARAMETER_LIST(pl_id);
                          
                          END;
                          Hope you understand...

                          Hamid
                          • 10. Re: how to pass the one form filed to second form parameter
                            997421
                            Hi hamid,verything is fine,but after click on the button i get three error messages


                            1)FRM-47001-cannot create parameter list TMPDATA list with name exits
                            2)FRM-47009-cannot add paramterpo_header_id to parameter list:invalid listid
                            3)FRM-47009-cannot add paramterpo_vendor_id to parameter list:invalid listid

                            already i am creating parameters in second form

                            Regards,
                            sekhar
                            • 11. Re: how to pass the one form filed to second form parameter
                              XeM
                              Have a look at this page

                              http://andreas.weiden.orcl.over-blog.de/article-28180655.html
                              • 12. Re: how to pass the one form filed to second form parameter
                                HamidHelal
                                994418 wrote:
                                Hi hamid,verything is fine,but after click on the button i get three error messages


                                1)FRM-47001-cannot create parameter list TMPDATA list with name exits
                                2)FRM-47009-cannot add paramterpo_header_id to parameter list:invalid listid
                                3)FRM-47009-cannot add paramterpo_vendor_id to parameter list:invalid listid

                                already i am creating parameters in second form
                                Hi, sekhar
                                Can you post your button code ? always post code in two same tag one is
                                Hamid                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
                                • 13. Re: how to pass the one form filed to second form parameter
                                  997421
                                  when button trigger code:
                                  -----------------------------

                                  declare
                                       pl_id PARAMLIST;
                                  BEGIN
                                  pl_id := Get_Parameter_List('tempdata');
                                  IF NOT Id_Null(pl_id) THEN
                                       Destroy_Parameter_List(pl_id);
                                  END IF;

                                       pl_id := Create_Parameter_List('tempdata');
                                       Add_Parameter(pl_id, 'PROJECTNAME', TEXT_PARAMETER, :PROJECT_SEGMENT1);
                                  Add_Parameter(pl_id, 'TASKCODE', TEXT_PARAMETER, :TASK_NAME);
                                       
                                       open_form ('/backup/home/applmgr/prodappl/xxpll/11.5.0/forms/US/XXPLL_BUTTON_FORM.fmx', activate, session, no_share_library_data,pl_id);
                                       DESTROY_PARAMETER_LIST(pl_id);

                                  END;
                                  • 14. Re: how to pass the one form filed to second form parameter
                                    HamidHelal
                                    994418 wrote:
                                    when button trigger code:
                                    -----------------------------

                                    declare
                                         pl_id PARAMLIST;
                                    BEGIN
                                    pl_id := Get_Parameter_List('tempdata');
                                    IF NOT Id_Null(pl_id) THEN
                                         Destroy_Parameter_List(pl_id);
                                    END IF;

                                         pl_id := Create_Parameter_List('tempdata');
                                         Add_Parameter(pl_id, 'PROJECTNAME', TEXT_PARAMETER, :PROJECT_SEGMENT1);
                                    Add_Parameter(pl_id, 'TASKCODE', TEXT_PARAMETER, :TASK_NAME);
                                         
                                         open_form ('/backup/home/applmgr/prodappl/xxpll/11.5.0/forms/US/XXPLL_BUTTON_FORM.fmx', activate, session, no_share_library_data,pl_id);
                                         DESTROY_PARAMETER_LIST(pl_id);

                                    END;
                                    seems your code is ok. if it not work and shows the same message. change parameter name
                                    tempdata to paramdata.

                                    try

                                    Hamid
                                    1 2 3 Previous Next