Searches the list of menu items and returns a menu item ID when it finds a valid menu item with the given name. You must define an appropriately typed variable to accept the return value. Define the variable with a type of MenuItem.
FUNCTION FIND_MENU_ITEM
(menu_name.menu_item_name VARCHAR2);
Built-in Type unrestricted function
Returns MenuItem
Enter Query Mode yes
/*
** Built-in: FIND_MENU_ITEM
** Example: Find the id of a menu item before setting
** multiple properties
*/
PROCEDURE Toggle_AutoCommit_Mode IS
mi_id MenuItem;
val VARCHAR2(10);
BEGIN
mi_id := Find_Menu_Item('Preferences.AutoCommit');
/*
** Determine the current checked state of the AutoCommit
** menu checkbox item
*/
val := Get_Menu_Item_Property(mi_id,CHECKED);
/*
** Toggle the checked state
*/
IF val = 'TRUE' THEN
Set_Menu_Item_Property(mi_id,CHECKED,PROPERTY_FALSE);
ELSE
Set_Menu_Item_Property(mi_id,CHECKED,PROPERTY_TRUE);
END IF;
END;