This discussion is archived
1 2 Previous Next 18 Replies Latest reply: Jan 17, 2013 9:25 PM by MAHA REDDY RSS

FRm-40741: unable to locate record 11 on block

MAHA REDDY Newbie
Currently Being Moderated
Hi All,

i am using this set custom property when press the find button " FRm-40741: unable to locate record 11 on block " error getting.

     If :XXEAM_SHUTDOWN_DETAILS.WF_STATUS = 'Not Submited Yet!' then
                    Set_Custom_Property('XXEAM_SHUTDOWN_DETAILS.WORK_ORDER_NO', :SYSTEM.TRIGGER_RECORD, 'ENABLED', TRUE);
                    Set_Custom_Property('XXEAM_SHUTDOWN_DETAILS.ESTIMATED_START_DATE',:SYSTEM.TRIGGER_RECORD, 'ENABLED', TRUE);
end if;


please give me any another property for record wise working instead of Set_Custom_Property.

Regards,
Maha
  • 1. Re: FRm-40741: unable to locate record 11 on block
    HamidHelal Guru
    Currently Being Moderated
    MAHA REDDY wrote:
    Hi All,

    i am using this set custom property when press the find button " FRm-40741: unable to locate record 11 on block " error getting.

         If :XXEAM_SHUTDOWN_DETAILS.WF_STATUS = 'Not Submited Yet!' then
                        Set_Custom_Property('XXEAM_SHUTDOWN_DETAILS.WORK_ORDER_NO', :SYSTEM.TRIGGER_RECORD, 'ENABLED', TRUE);
                        Set_Custom_Property('XXEAM_SHUTDOWN_DETAILS.ESTIMATED_START_DATE',:SYSTEM.TRIGGER_RECORD, 'ENABLED', TRUE);
    end if;
    hi, Maha
    You can try Set_item_property.


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

    Set_item_property. wont work record wise . i want to record wise disabled enabled button.

    please tell me record wise which property is working.

    Regards,
    Maha
  • 3. Re: FRm-40741: unable to locate record 11 on block
    FrançoisDegrelle Oracle ACE
    Currently Being Moderated
    Hello,

    You cannot enable/disable a single button on a given record, because the Set_Item_Instance_Property() built-in has no ENABLE option.
    All you can do is to enable/disable the buttons, using the Set_Item_Property() in a When-New-Record-Instance trigger.

    Francois
  • 4. Re: FRm-40741: unable to locate record 11 on block
    MAHA REDDY Newbie
    Currently Being Moderated
    Hi François,

    i want to record wise disable/enable fields and button .
    i used set_custom_property but it's showing error message.

    please give me any solution.

    Regards,
    MAHA.
  • 5. Re: FRm-40741: unable to locate record 11 on block
    FrançoisDegrelle Oracle ACE
    Currently Being Moderated
    I already gave you the solution. See my previous answer.
    Set_Custom_Property() is dedicated to PJCs and Java Beans.

    Francois
  • 6. Re: FRm-40741: unable to locate record 11 on block
    MLBrown Journeyer
    Currently Being Moderated
    It was already mentioned, but you can use SET_ITEM_PROPERTY on items and buttons as long as you are not navigated to that item or button when you set it.
    SET_ITEM_PROPERTY('BLOCK_NAME.FIELD_NAME', ENABLED, PROPERTY_FALSE);    -- BLOCK_NAME = name of your block/FIELD_NAME the name of your field
    SET_ITEM_PROPERTY('BLOCK_NAME.BUTTON_NAME', ENABLED, PROPERTY_FALSE);   -- BUTTON_NAME = name of your button
    Once you set an item to ENABLED property false it propagates and does the following (see help):
    sets the Navigable item property to False
    sets the Update_Null item property to False
    sets the Updateable item property to False

    Which means when you re-enable the item or the button you have to change those properties back to PROPERTY_TRUE as well.

    -mike
  • 7. Re: FRm-40741: unable to locate record 11 on block
    CraigB Guru
    Currently Being Moderated
    Maha,
    Well, I started to explain that the use of :SYSTEM.TRIGGER_RECORD in a When-Button-Pressed (WBP) trigger might be the cause, but I have a sample form where I use the SET_CUSTOM_PROPERTY() built-in to make items VISIBLE=false so I was able to duplicate the error that you are getting.

    In my sample form, the Set_Custom_Property() built-in still works even though the Error is reported; every-other record I hide an item - or in your case, disabled an item. I played around with my sample form but was unable to determine the cause of the error. As much as I hate to say this, the way I was able to elimiate the error was by simply ignoring it ( I hate to do this, I would much rather find the cause of the error and eliminate the cause then to supress errors). Consequently, I was able to eliminate the error by adding a Block level ON-ERROR trigger and testing the ERROR_CODE variable to see if it is 40741. If you have a higher level ON-ERROR trigger, you will need to change the Executeion Hierarchy property of all ON-ERROR triggers so each trigger will fire correctly. For example, in my sample form I changed the Block.ON-ERROR trigger Execution Hierarchy property to BEFORE and my Module/Form.ON-ERROR property to AFTER. This makes it so both triggers will fire. Here is the code is used in my Block.On-Error trigger.
    IF ( ERROR_CODE = 40741 ) THEN 
       null;
    END IF;
    By the way, I also changed my sample form and used the 'ENABLED' property instead of the 'VISIBLE' property and it worked just fine so you can continue to use the SET_CUSTOM_PROPERTY() built-in instead of having to use the Set_Item_Instance_Property or Set_Item_Property built-ins.

    Hope this helps,
    Craig...
  • 8. Re: FRm-40741: unable to locate record 11 on block
    HamidHelal Guru
    Currently Being Moderated
    MAHA REDDY wrote:
    Hi HamidHelal ,

    Set_item_property. wont work record wise . i want to record wise disabled enabled button.
    Hi, Maha

    The only help i can do.. is enabling and disabling a button


    hope this helps...


    Hamid
  • 9. Re: FRm-40741: unable to locate record 11 on block
    Andreas Weiden Guru
    Currently Being Moderated
    SET_CUSTOM_PROPERTY doesn't take the logical record-number as parameter, but the "physical row number" in the layout. So, if you have ten visible rows in your layout, you can give the numbers from 1 to 10 to SET_CUSTOM_PROPERTY. But SYSTEM.TRIGGER_RECORD contains the number of the record adn that can be larger than 10 (when you start scrolling).

    That said, you will have difficulties to do a record-wise enabled/disabling of items in a block. You would have to "re-caclulate" the setting on each record-change, including the blocks topmost-record in the calculation of the parameter you pass to SET_CUSTOM_PROPERTY.
  • 10. Re: FRm-40741: unable to locate record 11 on block
    ck Explorer
    Currently Being Moderated
    I have problem also with using set_custom_property in tabular to enabled/disabled button or check box (im not using :system.Trigger_record), if used in post-query trigger it will work on the first displayed queried record but if you tried to scroll down or navigate down for new record then this error arise cannot find the specified record number, i tried also to suppress this error but i have procedure to run when new_record_instance then it will not fire.

    So better used what they suggest using set_item_property, my case i hide this item or i made it not updateable/updateable.

    Then if you used in a button then put validation code when_button_press trigger under the button.
  • 11. Re: FRm-40741: unable to locate record 11 on block
    CraigB Guru
    Currently Being Moderated
    Andreas,
    Thanks for the clarification. You saved me a little research time! :)

    Craig...
  • 12. Re: FRm-40741: unable to locate record 11 on block
    user346369 Expert
    Currently Being Moderated
    Rather than use Set_Custom_Property, you can create text items that look like buttons. Then use Set_Item_Instance_Property to change the visual_attribute and border_bevel on the items, and get them to appear as if they are buttons that are enabled or disabled. Then, use a When-Mouse-Click trigger instead of When-Button-Pressed to effect a button press.

    Within the WMC trigger, you would probably need to re-check the same logic used to determine whether a button-press should be allowed, since the When-Mouse-Click trigger will run no matter what the visual attribute is on the item.

    If you use this method, you aren't stuck with trouble when the user scrolls the block, but the Set_Custom_Property still affects the original visible rows of the block.
  • 13. Re: FRm-40741: unable to locate record 11 on block
    CraigB Guru
    Currently Being Moderated
    I finally got a few minutes to play with my sample form and discovered that Andreas is correct when he stated:
    SET_CUSTOM_PROPERTY doesn't take the logical record-number as parameter, but the "physical row number" in the layout.
    In my sample form, as I scrolled through the records the "Enabled" items did not change with the records.

    *@Maha,* my apologies. In order to implement the affect you desire, you will have to mimic the Enabled/Disabled property for each record by using a combination of the Set_Item_Instance_Property() built-in and the INSERT_ALLOWED, UPDATE_ALLOWED, NAVIGABLE, and VISUAL_ATTRIBUTE (optional) properties. Because you have modify so many properties, I wrap this in a procedure called ENABLE_ITEM and pass the Item, Record Number and Enable parameters. For example:
    /* This procedure assumes you have a VISUAL_ATTRIBUTE                 */
    /* created called 'ENABLED' and 'DISABLED'.  In my example,           */
    /* I created the DISABLED visual attribute with following properties: */
    /*  Foreground Color = DarkGray                                       */
    /*  Background Color = gray12                                         */
    /* The ENABLED visual attribute does not specify any properties so it */
    /* sets the above properties back to <Unspecified>                    */
    PROCEDURE enable_item (inItem VARCHAR2, inRecord NUMBER, inEnabled BOOLEAN )IS
         paramCount     NUMBER := 0;
    BEGIN
         IF ( inEnabled ) 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);
              Set_Item_Instance_Property(inItem, inRecord, VISUAL_ATTRIBUTE, 'ENABLED');
         ELSE
               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);
              Set_Item_Instance_Property(inItem, inRecord, VISUAL_ATTRIBUTE, 'DISABLED');
      END IF;
    END enable_item;
    You then call the ENABLE_ITEM procedure in your code passing the name, record number, and enable (true or false) to disable your item. For example:
    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);
    end if;
    The options Francois and Steve mentioned are also good ways to do this as well.

    Sorry if I confused the issue earlier.

    To those that suggested using SET_ITEM_PROPERTY('BLOCK_NAME.ITEM_NAME',ENABLED, PROPERTY_FALSE), don't forget the cascade affect of setting the ENABLED property of an item to false. When you ENABLE your item later, you have to also set the NAVIGABLE, UPDATE_NULL, UPDATEABLE properties to TRUE.

    Craig...

    Edited by: CraigB on Jan 16, 2013 2:15 PM
  • 14. Re: FRm-40741: unable to locate record 11 on block
    MAHA REDDY Newbie
    Currently Being Moderated
    Hi CraigB ,

    Thanks For Help it is working. but at the same time SEND button also need to disabled record wise. i have writen like this..


    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;


    Is it possible record wise disable/enable button .


    Regards,
    Maha
1 2 Previous Next

Legend

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