FRM-41067: Cannot find menu item: invalid Id

From: Teresa Robinson <usenet_at_teresarobinson.net>
Date: Fri, 19 May 2006 10:54:47 -0400
Message-ID: <mvar62lkkspqc7ipk6kpppoo868dlndko8_at_4ax.com>



Hello,

Sorry for the long post, I want to give as many details as possible.

I'm trying to insert two menu items into an existing custom menu, using Forms 6i on Windows XP Pro, connecting to 9i v2.

The form uses a library to check the rights of the user and performs a role asssignment depending on those rights, then goes on to enable-disable the menu items depending on the role.

We have a table called module_mappings that has records of all functional areas, module names, module types, and the fully qualified menu item name ('menu.menu_item'). Ex:

FN_AREA MOD_NM MOD_TP MI_NAME

AREA1        MOD1          TYPE1       MENU1
AREA1        MOD2          TYPE1       MENU2
AREA1        MOD3          TYPE2       MENU3
AREA2        MOD4          TYPE1       MENU4
...

Type can be Form or Report, Module is the name of the form, the file name, and menu_item name is the name of the item you see in the object navigator. I have inserted the two new menu items into the menu in Forms developer, and inserted the two new records into this table. I have followed the code into the library all the way to the line that the error occurs on, 'set_menu_item_property':

...

   CURSOR c_modules(v_func_area IN VARCHAR2) IS    SELECT menu_item
   FROM module_mappings
   WHERE functional_area = v_func_area;

v_menu_item MENUITEM;
v_status VARCHAR2(10);
...
--suppose menu_item = 'MENU2'

FOR c_mod IN c_modules('AREA1') LOOP
  v_menu_item := FIND_MENU_ITEM(c_mod.menu_item);
--this line returns null ^^^

  set_menu_item_property(v_menu_item, ENABLED,PROPERTY_TRUE);
--this line fails ^^^

END LOOP; What happens is that on the two new menu items, no ID is found at the 'find_menu_item' function, so v_menu_item is null at the next line. I've tried it with passing in the fully qualified name (which is not recommended), and that got IDs, but the error still happens after all the menu items are enabled and the screen loads.

Further, if I take all new code and menu items out and delete the two rows from the table, the error still happens! It doesn't even work when you replace the files with earlier versions!

I just don't get it, and I can't find anything on Google or Metalink that tells me how to deal with this.

Thanks in advance for any advice!
--

Teresa Robinson
Staff Programmer Analyst
Anteon Corporation
trobinson at anteon dot com Received on Fri May 19 2006 - 16:54:47 CEST

Original text of this message