10 Replies Latest reply: Sep 16, 2013 11:49 AM by Andreas Weiden RSS

    Developer Forms 6i Parameter Passing

    NZK

      Dear All

       

      Please help me on the following

       

      I'm trying to pass a CHAR value from one form to another using a PARAMETER. The passing value is "COD/0001", when I try to pass this value it doesn't pass. But if I try passing without "COD/" it works fine. What I realized is the numbers are passing except the Characters.

       

      My Parameter type is CHAR. The passing and receiving fields and Database columns types are CHAR as well.

       

      Please help me to overtake this issue.

       

      Thank you in advance.

       

      Nazik

        • 1. Re: Developer Forms 6i Parameter Passing
          InoL

          >when I try to pass this value it doesn't pass.

           

          That is not very informative.

          Are you sure the parameter is of type Char, not Number?

          Do you get an error?

          Is the length of the parameter correct?

          Can you show us your code?

          • 2. Re: Developer Forms 6i Parameter Passing
            Dev. Musbah

            You can use a Global variable to pass values between Forms like this: :Global.FieldName

            use this global variable (:Global.FieldName) in the sending and receiving forms directly without declaring it

            • 3. Re: Developer Forms 6i Parameter Passing
              NZK

              Dear InoL

               

              My Header Form coding as follows.

              When I press the button to move to the lines the following code executes

               

              PASSING FORM CODING;

              DECLARE

                   pl PARAMLIST := GET_PARAMETER_LIST('PL_AT');

              BEGIN

                   IF NOT ID_NULL(pl) THEN

                        DESTROY_PARAMETER_LIST(pl);

                   END IF;

                   pl := CREATE_PARAMETER_LIST('PL_AT');

                   ADD_PARAMETER(pl,'P_AT',TEXT_PARAMETER,:HWSI_ASSET_TAG);

                   CALL_FORM('E:\IT_SYSTEM\6i\HWDYNAMICINFO.FMX',NO_HIDE,DO_REPLACE,NO_QUERY_ONLY,PL);

              END;

               

              RECEIVING FORM CODING;

              Written on WHEN_NEW_FORM_INSTANCE

               

              BEGIN

                   IF :PARAMETER.P_AT IS NULL THEN

                        GO_ITEM('NZK_HW_DYNAMIC.OS_ASSET_TAG');

                        ENTER_QUERY;

                   ELSE

                        SET_BLOCK_PROPERTY('NZK_HWSTATIC_INFO',DEFAULT_WHERE,'HWSI_ASSET_TAG ='||:parameter.p_at);

                       SET_BLOCK_PROPERTY('NZK_HWSTATIC_INFO',DEFAULT_WHERE,'HWSI_ASSET_TAG ='||:parameter.p_at);

               

                        EXECUTE_QUERY;

                        GO_ITEM('NZK_HW_DYNAMIC.OS_ASSET_TAG');

                   END IF;

              END;

               

              Created PARAMETER as P_AT, Data Type CHAR, MAX LENGTH 30

               

              --------------------------------------------------------------------

               

              Thank you

               

              NZK

              • 4. Re: Developer Forms 6i Parameter Passing
                Andreas Weiden

                How did you check that the value isn't passed correctly? I only ask because you build the default_where in a wrong way, you're missing the quotes as you parameter is a character-parameter.

                • 5. Re: Developer Forms 6i Parameter Passing
                  NZK

                  Dear Andreas

                   

                  I checked by entering values to the Header Form. If I enter a number (Ex 0001,123, etc) it passes to the Lines form field,

                  but If I enter a Character value (For Ex. ABC/0124) It doesn't pass to the lines and it gives an error message saying ORA-00904: 'ABC': invalid identifier

                   

                  Thank you

                  Nzk

                  • 6. Re: Developer Forms 6i Parameter Passing
                    NZK

                    Dear Musbah

                     

                    Thank you for your reply.

                     

                    But I have used parameter before with numbers. But I want to make sure why it is not working with Characters and what is the mistake that I'm doing.

                     

                    Thanks

                     

                    NZK

                    • 7. Re: Developer Forms 6i Parameter Passing
                      Andreas Weiden

                      So it's as i said. You didn't actually check the parameter-value, and ORA-00904 indicates  even more that the parameter is passed correctly. Your setting of the default-where is wrong.

                       

                      It results in

                       

                      HWSI_ASSET_TAG =CAD/001
                      

                       

                      which is wrong. The result should be

                       

                      HWSI_ASSET_TAG ='CAD/001'
                      

                       

                      So your code should be either

                       

                      SET_BLOCK_PROPERTY('NZK_HWSTATIC_INFO',DEFAULT_WHERE,'HWSI_ASSET_TAG =:parameter.p_at');
                      

                       

                      or

                       

                      SET_BLOCK_PROPERTY('NZK_HWSTATIC_INFO',DEFAULT_WHERE,'HWSI_ASSET_TAG ='''||:parameter.p_at || '''');
                      
                      • 8. Re: Developer Forms 6i Parameter Passing
                        NZK

                        Dear Andreas

                         

                        Perfect, the second option works fine. Thank you for your support

                         

                        NZK

                        • 9. Re: Developer Forms 6i Parameter Passing
                          NZK

                          Dear Andreas

                           

                          The second option worked perfectly. Could you please clarify the reason of adding two single quotes before the parameter and four single quotes (''||:parameter.p_at || '''') after the parameter?

                           

                          NZK

                          • 10. Re: Developer Forms 6i Parameter Passing
                            Andreas Weiden

                            If you want to use a quote inside a string literal you have to put two quotes in it. So with the four quotes, the first is the start of the string the second and third indicate one quote and the fourth is the end of the string.