1 Reply Latest reply on Jul 16, 2013 2:33 PM by Andreas Weiden

    No data found error on click a item whose update_allowed property set to false

    yash_08031983

      Hello Expert,

       

      i am using form 10g. on when-new-form instance trigger following code is executing:

      trigger name : My_trigger

      {code}

      DECLARE

        L_FIRST_BLOCK VARCHAR2(50);

        L_LAST_BLOCK VARCHAR2(50);

        L_CUR_BLOCK VARCHAR2(50);

        L_NEXT_BLOCK VARCHAR2(50);

        CUR_FORM VARCHAR(50) := :SYSTEM.CURRENT_FORM;

        L_BLOCK_TABLE VARCHAR2(100);

      /* This program will check every database block table and set the updatable property according to access flag. */

      BEGIN

       

       

        L_FIRST_BLOCK := GET_FORM_PROPERTY(CUR_FORM,FIRST_BLOCK);

       

       

        L_LAST_BLOCK := GET_FORM_PROPERTY(CUR_FORM,LAST_BLOCK);

       

       

        L_CUR_BLOCK := L_FIRST_BLOCK;

       

       

        ---------Check every block in loop

        LOOP

       

       

        ------Check Database Block table Name

       

       

        L_BLOCK_TABLE := GET_BLOCK_PROPERTY(L_CUR_BLOCK,QUERY_DATA_SOURCE_NAME);

       

       

        -------If Table exists then check every field's access flag and set property accordingly

        IF NVL(L_BLOCK_TABLE,' ')<>' ' THEN

         DECLARE

         L_FIRST_ITEM VARCHAR2(100);

        L_LAST_ITEM VARCHAR2(100);

        L_CUR_ITEM VARCHAR2(100);

        L_ACCESS VARCHAR2(1);

         BEGIN

       

       

          L_FIRST_ITEM := L_CUR_BLOCK||'.'||GET_BLOCK_PROPERTY(L_CUR_BLOCK,FIRST_ITEM);

          L_LAST_ITEM  := L_CUR_BLOCK||'.'||GET_BLOCK_PROPERTY(L_CUR_BLOCK,LAST_ITEM);

       

       

          L_CUR_ITEM   := L_FIRST_ITEM;

          LOOP

                IF Get_Item_Property(L_CUR_ITEM,ITEM_TYPE) NOT IN ('BUTTON','CHART ITEM','DISPLAY ITEM','IMAGE','VBX CONTROL') THEN

               

                    IF Get_Item_Property(L_CUR_ITEM,ITEM_CANVAS) IS NOT NULL THEN

                    IF Get_Item_Property(L_CUR_ITEM,ENABLED) <> 'FALSE' THEN

                    IF Get_Item_Property(L_CUR_ITEM,VISIBLE) <> 'FALSE' THEN

                      IF Get_Item_Property(L_CUR_ITEM,CONCEAL_DATA) <> 'TRUE' THEN

                    

                  L_ACCESS := CHECK_ACCESS_FLAG(L_BLOCK_TABLE,USER,L_CUR_ITEM);

       

                 IF L_ACCESS = 'Y' THEN

                   SET_ITEM_PROPERTY(L_CUR_ITEM,UPDATE_ALLOWED,PROPERTY_TRUE);

                   --SET_ITEM_PROPERTY(L_CUR_ITEM,INSERT_ALLOWED,PROPERTY_TRUE);

                  

                 ELSE

                   SET_ITEM_PROPERTY(L_CUR_ITEM,UPDATE_ALLOWED,PROPERTY_FALSE);

                   --SET_ITEM_PROPERTY(L_CUR_ITEM,INSERT_ALLOWED,PROPERTY_FALSE);

                  

                  END IF;

              END IF;

              END IF;  

             END IF;

                    --ELSE

                    -- MESSAGE(L_CUR_ITEM||' CANVAS '||Get_Item_Property(L_CUR_ITEM,ITEM_CANVAS));MESSAGE(L_CUR_ITEM||' CANVAS '||Get_Item_Property(L_CUR_ITEM,ITEM_CANVAS));

         END IF;

                END IF;

                IF L_CUR_ITEM = L_LAST_ITEM THEN

                  EXIT;

        END IF;

                L_CUR_ITEM := L_CUR_BLOCK||'.'||GET_ITEM_PROPERTY(L_CUR_ITEM, NEXTITEM);

          END LOOP;

         END;

        END IF;

        IF L_CUR_BLOCK = L_LAST_BLOCK THEN

        EXIT;

        END IF;

        L_CUR_BLOCK := GET_BLOCK_PROPERTY(L_CUR_BLOCK,NEXTBLOCK);

        END LOOP;

        GO_BLOCK(L_FIRST_BLOCK);

      END;

      {code}

       

      When-new-form-instance trigger code

      execute_trigger('My_trigger');

       

      when i click on any item and try to update, its showing message at status bar:

      frm-1403, ora-01403 no data found.

       

      it should give , field is protected. or should show user define message, like "you can not update this field".

       

      Please help.

       

      Thanks

      Yash