Form 6i
I want to disable or enable Menu Item as per user Requirements.
I created a table and put some rows in it.
now I am using this code in when-new-form-instance
Declare
menuitem_name varchar2(100) ;
mi_id MenuItem;
mi varchar2(100);
fnm varchar2(20);
Cursor c2 is
select userid,username,status,form_name from user_forms where username = :g_user;
--r1 c2%rowtype;
vuid user_forms.userid%type;
vunm user_forms.username%type;
vstat user_forms.status%type;
vfnm user_forms.form_name%type;
begin
menuitem_name := 'SETUP_MENU.';
open c2;
loop
fetch c2 into vuid,vunm,vstat,vfnm;
exit when c2%notFOund;
MI := Menuitem_name||vfnm;
-- SYNCHRONIZE;PAUSE;
mi_id := Find_Menu_Item(mi);
IF Get_Menu_Item_Property(mi_id,ENABLED) = 'TRUE' THEN
set_menu_item_property('SETUP_MENU'||vfnm,enabled,property_false);
end if;
end loop;
end;
after run this form showing me message SETUP_MENU.CITY and also shows
Cannot Find Menu Item Invalid ID
when It find SETUP_MENU.CITY why showing message Cannot Find Menu Item Invalid ID.?
and the other hand when I use another code
declare
menuitem_name varchar2(100) := 'SETUP_MENU.CITY';
mi_id MenuItem;
BEGIN
mi_id := Find_Menu_Item(menuitem_name);
IF Get_Menu_Item_Property(mi_id,ENABLED) = 'TRUE' THEN
Set_Menu_Item_Property(mi_id,ENABLED,PROPERTY_FALSE);
END IF;
END;
it is working accordingly,
difference is that in my first code I am calling data from table and I also display on screen
message (MI); -- It returns SETUP_MENU.CITY as I use in 2nd code
please guide me why first code is not run accordingly.