This discussion is archived
1 2 Previous Next 18 Replies Latest reply: Jan 17, 2013 9:25 PM by MAHA REDDY Go to original post RSS
  • 15. Re: FRm-40741: unable to locate record 11 on block
    Andreas Weiden Guru
    Currently Being Moderated
    Did you read the answers you got? It is not possible using the standard. What about putting a single button on top of all records?
  • 16. Re: FRm-40741: unable to locate record 11 on block
    user346369 Expert
    Currently Being Moderated
    Maha, CraigB's "Enable_Item" procedure does NOT enable or disable anything. As he wrote, "you will have to _*mimic*_ the Enabled/Disabled property"

    You can NOT enable or disable items at the record level. All you can do is make them LOOK LIKE they are enabled or disabled.

    Read what I wrote above -- make text items LOOK LIKE they are buttons, and use Craig's procedure to change their appearance -- at least the Visual Attribute part. I like to set the Border_Bevel property, too.

    Finally, within the when-mouse-click trigger, you need to check the item's Visual Attribute, whether it is set to the Enabled or Disabled V.A., to determine whether the user should be allowed to run whatever that mouse-click does, since the when-mouse-click will run on all the records, no matter what visual attribute is assigned.

    The most annoying part of using this workaround is that the mouse pointer remains a text-cursor vertical bar shape when you hover over the items that mimic buttons. When you hover the pointer over a button, it changes to a real arrow.
  • 17. Re: FRm-40741: unable to locate record 11 on block
    CraigB Guru
    Currently Being Moderated
    For the Button, Steve's suggestion of using a Text_Item that simulates a button would work, but your button code will only execute if the user clicks the "Button" with the mouse. If your users use both the mouse and the keyboard to activate the button this method will not work.

    Since the application I work on requires keyboard and mouse support, I would stick with using the When-Button-Pressed trigger but add a check at the beginning to see if the Button is enabled or not. You will need to modify the ENABLE_ITEM procedure to work with buttons. For example:
    PROCEDURE enable_item (inItem VARCHAR2, inRecord NUMBER, inEnabled BOOLEAN )IS
       paramCount     NUMBER := 0;
       itemIsButton BOOLEAN := FALSE;
    BEGIN
       IF ( Get_Item_Property(inItem, ITEM_TYPE) = 'BUTTON' ) THEN 
          itemIsButton := TRUE;
       END IF;
         
       IF ( inEnabled ) THEN
          IF ( NOT itemIsButton ) THEN 
             Set_Item_Instance_Property(inItem, inRecord, INSERT_ALLOWED, PROPERTY_TRUE);
             Set_Item_Instance_Property(inItem, inRecord, UPDATE_ALLOWED, PROPERTY_TRUE);
             Set_Item_Instance_Property(inItem, inRecord, NAVIGABLE, PROPERTY_TRUE);
          END IF;
          Set_Item_Instance_Property(inItem, inRecord, VISUAL_ATTRIBUTE, 'ENABLED');
       ELSE
          IF ( NOT itemIsButton ) THEN
             Set_Item_Instance_Property(inItem, inRecord, INSERT_ALLOWED, PROPERTY_FALSE);
             Set_Item_Instance_Property(inItem, inRecord, UPDATE_ALLOWED, PROPERTY_FALSE);
             Set_Item_Instance_Property(inItem, inRecord, NAVIGABLE, PROPERTY_FALSE);
          END IF;
          Set_Item_Instance_Property(inItem, inRecord, VISUAL_ATTRIBUTE, 'DISABLED');
       END IF;
    END;
    Then, modify your When-Button-Pressed (WDP) trigger to add the following check:
    BEGIN
       IF ( NOT Get_Item_Instance_Property(:SYSTEM.TRIGGER_ITEM,:SYSTEM.TRIGGER_RECORD,VISUAL_ATTRIBUTE) = 'DISABLED' ) THEN
          /* execute your WBP Logic here... */
       END IF;
    /* All button logic must be inside your Conditional */
    END;  
    Your user can still click the button or use the keyboard to activate the button, but nothing will happen. You could even force the navigation cursor to move to a different item if you wanted too.

    Hope this helps,
    Craig...
  • 18. Re: FRm-40741: unable to locate record 11 on block
    MAHA REDDY Newbie
    Currently Being Moderated
    Hi CraigB ,

    i have written procedure which is proposed you and in when button pressed trigger i have written like this.

    BEGIN
    IF ( NOT Get_Item_Instance_Property(:SYSTEM.TRIGGER_ITEM,:SYSTEM.TRIGGER_RECORD,VISUAL_ATTRIBUTE) = 'DISABLED' ) THEN

    If :XXEAM_SHUTDOWN_DETAILS.WF_STATUS = 'Not Submited Yet!' then
    enable_item('XXEAM_SHUTDOWN_DETAILS.WORK_ORDER_NO', :SYSTEM.TRIGGER_RECORD, TRUE);
    enable_item('XXEAM_SHUTDOWN_DETAILS.ESTIMATED_START_DATE',:SYSTEM.TRIGGER_RECORD, TRUE);
    else :XXEAM_SHUTDOWN_DETAILS.WF_STATUS = 'APPROVED' then
    enable_item('XXEAM_SHUTDOWN_DETAILS.SEND', :SYSTEM.TRIGGER_RECORD, FALSE);
    end if;

    end if;
    end;

    Regards,
    Maha
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points