10 Replies Latest reply: Mar 27, 2009 11:43 AM by Sandy310 RSS

    frm-41052 cannot find window: invalid id

    Sandy310
      Hi,

      while running form I am getting error frm-41052 cannot find window: invalid id. Please help me to resolve this issue.
      I am on Oracle 10g and database 10g.


      Thanks
      Sandy
        • 1. Re: frm-41052 cannot find window: invalid id
          Fabrizio Delli Priscoli
          Which is your code that generate error???
          Fabrizio
          • 2. Re: frm-41052 cannot find window: invalid id
            Sandy310
            I get this error immdetaily before form screen pops up. I hit OK then again get same message and can see form screen. Please let me know which code are you talking about..because I have not written any code for window display.

            Thanks
            • 3. Re: frm-41052 cannot find window: invalid id
              Fabrizio Delli Priscoli
              Check if you have written some set_window_property or some other code that set value in a window.
              Probably the name of the window is not correct.
              Hope it helps you,
              Fabrizio

              If this answer is helpful or correct, please mark it. Thanks.
              • 4. Re: frm-41052 cannot find window: invalid id
                Sandy310
                this is the code at Form level : WHEN_NEW_FORM_INSTANCE . I am still getting same error

                DECLARE
                     v_userid     user_id.user_id%TYPE;
                     it_id item;
                BEGIN
                     DEFAULT_VALUE('10','GLOBAL.CLIENT');
                --- :parameter.p_packing_id := 10000; --- for testing only
                dbms_application_info.read_client_info(v_userid);
                IF v_userid IS NULL THEN
                dbms_Application_info.set_client_info('XYZ');
                END IF;
                set_window_property('MAIN_WINDOW', TITLE, 'PACKAGE DETAILS');
                form_setup_pkg.event('WHEN-NEW-FORM-INSTANCE');
                IF :PARAMETER.P_PACKING_ID is NOT NULL THEN
                EXECUTE_QUERY;
                END IF;


                *******************************************************************************************

                when I excute my query in form I get another error FRM-40505
                :ORACLE error: unable to perform query. When I check display error this is
                the message and query


                SELECT ORDER_NUMBER,CLIENT,QUANTITY,PACKING_ID,LETTER_ORDER_CODE,
                ACTUAL_CARRIER,LETTER_ORDER_NUMBER,ACTUAL_SHIPMENT_TYPE,WEIGHT,PACKAGE_NUMBER FROM PACKING WHERE CLIENT = :1

                ORA-00904: "LETTER_ORDER_NUMBER": invalid identifier


                END;
                • 5. Re: frm-41052 cannot find window: invalid id
                  Fabrizio Delli Priscoli
                  set_window_property('MAIN_WINDOW', TITLE, 'PACKAGE DETAILS');

                  Make sure that you have a window named 'MAIN_WINDOW';



                  form_setup_pkg.event('WHEN-NEW-FORM-INSTANCE');
                  IF :PARAMETER.P_PACKING_ID is NOT NULL THEN
                  EXECUTE_QUERY;
                  END IF;
                  Which is the code of this package?


                  SELECT ORDER_NUMBER,CLIENT,QUANTITY,PACKING_ID,LETTER_ORDER_CODE,
                  ACTUAL_CARRIER,LETTER_ORDER_NUMBER,ACTUAL_SHIPMENT_TYPE,WEIGHT,PACKAGE_NUMBER FROM PACKING WHERE CLIENT = :1
                  Where you set field client?
                  Check it.
                  Fabrizio
                  • 6. Re: frm-41052 cannot find window: invalid id
                    Sandy310
                    set_window_property('MAIN_WINDOW', TITLE, 'PACKAGE DETAILS');

                    Make sure that you have a window named 'MAIN_WINDOW';

                    YES, I do have.

                    form_setup_pkg.event('WHEN-NEW-FORM-INSTANCE');
                    IF :PARAMETER.P_PACKING_ID is NOT NULL THEN
                    EXECUTE_QUERY;
                    END IF;
                    Which is the code of this package?

                    PACKAGE BODY FORM_SETUP_PKG IS
                    --
                    PROCEDURE EVENT ( i_event IN VARCHAR2 )
                    IS
                    BEGIN
                         /*
                         Modify this package body to add events during form startup
                         and to modify the window name and window title
                         */
                         
                         IF i_event = 'PRE-FORM' THEN
                    SET_WINDOW_PROPERTY(FORMS_MDI_WINDOW,WINDOW_STATE,MAXIMIZE);
                    SET_WINDOW_PROPERTY('BLOCKNAME',WINDOW_STATE,MAXIMIZE);
                    SET_WINDOW_PROPERTY(FORMS_MDI_WINDOW, TITLE, 'GEMS');
                    set_window_property('BLOCKNAME', TITLE, 'Template Form');
                         ELSIF i_event = 'WHEN-NEW-FORM-INSTANCE' THEN
                              null;
                         ELSE
                              null;
                         END IF;
                    END EVENT;

                    END;


                    SELECT ORDER_NUMBER,CLIENT,QUANTITY,PACKING_ID,LETTER_ORDER_CODE,
                    ACTUAL_CARRIER,LETTER_ORDER_NUMBER,ACTUAL_SHIPMENT_TYPE,WEIGHT,PACKAGE_NUMBER FROM PACKING WHERE CLIENT = :1
                    Where you set field client?

                    This is my code I am not selecting client anywhere, I dont know from where "Display error" is fecthing client query.
                    Thanks a lot for your help.

                    PACKAGE BODY ORDERS IS
                    PROCEDURE post_query IS
                    BEGIN
                    SELECT     pa.ship_to_last_name,
                         pa.ship_to_first_name,
                         pa.ship_to_address1,
                    pa.letter_order_number,
                         pa.letter_order_code,
                    INTO :ORDERS.SHIP_TO_LAST_NAME,
                    :ORDERS.SHIP_TO_FIRST_NAME,
                    :ORDERS.SHIP_TO_ADDRESS1,
                    :ORDERS.LETTER_ORDER_NUMBER,
                    :ORDERS.LETTER_ORDER_CODE,
                         :ORDERS.DC
                    FROM packing_attr pa
                    WHERE pa.packing_id = :ORDERS.PACKING_ID;
                         
                    end post_query;          
                    END orders;


                    Thanks
                    Sandy
                    • 7. Re: frm-41052 cannot find window: invalid id
                      Fabrizio Delli Priscoli
                      OK.

                      IF :PARAMETER.P_PACKING_ID is NOT NULL THEN
                      EXECUTE_QUERY;
                      END IF;

                      Which is the value of :PARAMETER.P_PACKING_ID???
                      you make an execute query. I suppose is on the first navigation data_block.
                      In the property palette of this block, have you set the where condition in some way??
                      Because I don't understand this: WHERE CLIENT = :1. Where is setup it?
                      Fabrizio
                      • 8. Re: frm-41052 cannot find window: invalid id
                        Sandy310
                        IF :PARAMETER.P_PACKING_ID is NOT NULL THEN
                        EXECUTE_QUERY;
                        END IF;

                        Which is the value of :PARAMETER.P_PACKING_ID???
                        I ahve created a paramtere P_PACKING_ID which has data type=number (in object navigator parameter node).
                        Actually requiremnet is to find order details by Packing_ID. User will give Packing_id and will get all order details.
                        I am not sure whether I need to create parameter for this?

                        you make an execute query. I suppose is on the first navigation data_block.
                        Yes

                        In the property palette of this block, have you set the where condition in some way??
                        Because I don't understand this: WHERE CLIENT = :1. Where is setup it?

                        YES it is in first datablock. I have one more question why is it taking Packing table in" Display error" beacause this table doesnot have letter_code coulmn. Please tell me from where "Display error" query is coming?

                        Thanks
                        Sandy
                        • 9. Re: frm-41052 cannot find window: invalid id
                          Sandy310
                          I guess I got it this time. I have created only one data block which has all 24 fields which are required for this form .
                          All these fields come from 3 tables which has common coulmn Packing_ID.

                          I have given Datablock property Query_Data_Source_nmae=Packing and where clause client=:global_client
                          that is why im getting "Display error" query. thanks for pointing it out.

                          Please tell me the best way to create this form :

                          how many datablocks should I create and wht shd be strategy because itmes could be scartted all over the place ( i mean its not that itmes from one table can be at one place).


                          Thanks

                          Edited by: sandy162 on Mar 27, 2009 9:02 AM
                          • 10. Re: frm-41052 cannot find window: invalid id
                            Sandy310
                            If you want to join multiple table in same data block 10g

                            goto Oracle forms Help>Search>JOIN of Multiple Tables

                            It gives all the information step by step..very interesting





                            Hope it helps
                            Sandy