Document-ID: 16136.1
Subject: (V4/V45) COMMON MENU QUESTIONS AND ANSWERS
Author: GKAMINAG
Last Modified Date: 09 February 1995
Common Menu Problems, Question, and Answers
Introduction
============
This bulletin is a list, in question/answer format, of the most common
problems reported to Oracle Support by customers building menu applications
in Oracle Forms 4.0. Most of the information will also apply to users of
Oracle Forms 4.5.
In order to compile a complete list of menu debugging help, you will also
want to obtain the bulletins "Linking a Form to a Menu"(Bulletin #106754.089)
and "Upgrading Menu Applications"(Bulletin #106754.004)
This bulletin assumes a basic familiarity with the menu-building process.
If you are not familiar with this process, then you may wish to review the
appropriate chapter in the Oracle Forms User's Guide (called the Oracle Forms
Developer's Guide in V4.5)
Using the Menu Editor
===============================================================================
Q. (V4.0 Only) I made some simple changes to my menu, then saved and
generated. When I ran the menu, though, the changes were not there.
A. Changes made in the menu editor will not take effect in the module until
the OK button is pressed. It is analogous to the Control -> Apply
operation in the Layout Editor. If the Menu Editor is open when you
save or generate, your most recent changes won't be reflected.
Be aware, however, that when you hit OK the menu editor window will
close. If you have a form module open at that time, the menu module will
be "hidden" behind it -- the Menu menu will be greyed out, and you will
have to use the Edit -> Modules dialog box to bring it back.
The best way to work with menus is to select Menu -> PL/SQL Program Units
when you first open a menu module. Since this small window is part of the
menu module, by activating this window we can bring the menu module
to the front of the module stack without selecting Edit -> Modules.
When you want to generate or save the menu, press OK on the menu editor,
activate the Units window (you can use the Window menu), then select
File -> Save and File -> Generate.
Q. (V4.0 Only) I cannot delete menu items. I blank it out, but I get
the alert message FRM-10005: Value is Required.
A. To delete menu items, the [Delete Element] key should be used.
For Windows this is Cntrl+<, which is actually three keys: Control, Shift,
and <. Use show keys (usually ^K) to find out the key combination for
other platforms.
Q. How can I edit the security tables to create roles? It is greyed out on
the File menu.
A. For V4.0 users, log into forms as SYSTEM and choose File -> Grant Role
Access. Click on Grant, fill in your ORACLE username, and click OK.
If Grant Role Access is greyed out when you log in as SYSTEM, then
your Oracle Forms base tables are not installed. Please refer to
bulletin 106690.304, "How to Install Base Tables for Oracle Forms 4.0"
for instructions on installing the base tables.
For V4.5 users, in order to modify roles you must be a DBA. Having
CREATE ROLE, ALTER ANY ROLE, DELETE ANY ROLE is not sufficient.
Menu Layout and Coding Menu Items
===============================================================================
Q. How do I change the default menu?
A. There is an approximation of the default menu in the file MENUDEF.MMB,
which is part of a standard installation of Oracle Forms. (On Windows
systems, it is found in C:\ORAWIN\FORMS40. For UNIX systems, it should
be in $ORACLE_HOME/forms40/demo. If you are unable to find this file,
please contact Oracle Support) Slight variations on the default menu
can be achieved by copying this menu to another file, editing that
copy, then attaching forms to that modified menu file.
Keep in mind that changing the MENUDEF.MMB will not change the menus of
forms which use the default menu. The default menu is hard-coded as part
of the runform executable, and cannot be changed. To show anything other
than the default menu, each form must be attached to a custom menu.
Q. How can I get the help menu to display on the far right of the menu bar?
A. Normally, menu items will be laid out left-to-right along the menu bar,
starting from the extreme left. Motif standards, however, call for the
help menu to be displayed on the extreme right-hand side. To move
your help menu item to the extreme right, set its Type property to
Magic, and its Magic property to Help. This makes it a magic menu item,
which signals Oracle Forms to treat it in an platform-standard way.
Thus, on Motif the menu will be on the far right, in Windows it will be
left-justified, but the rightmost menu, and on a Mac it will be displayed
under the Baloon icon.
Q. I have a menu item which references the bind variables :UN and :PW.
When I try to compile this, I get PL/SQL Error 49: Bad Bind Variable
A. The PL/SQL compiler in version 4.0.12 of Oracle Forms was unable to
resolve these references (bug 191771). This problem is fixed in versions
4.0.13 and higher. To work around this problem in version 4.0.12,
avoid compiling the menu item. Instead, hit OK on the menu editor and
generate. The menu will generate fine. Only the PL/SQL compiler has
trouble.
Q. (MS Windows Only) I am trying to run SQL*Plus from my menu item, but when
I select it, the screen flashes and nothing happens.
A. Change the code for the SQL*Plus invocation from "sqlplus scott/tiger"
to "plus31 scott/tiger".
Oracle Forms Menu will interpret SQL*Plus invocations as OS commands.
This is true if you call SQL*Plus from a PL/SQL menu item through a HOST
command or even if you use the SQL*Plus menu item type. Forms thus
treats it like any other OS command -- it submits it to Windows to
see if it is a windows command, then, if it fails there, it submits it
to DOS. So, Oracle Forms first tries to run a windows program called
SQLPLUS, fails (since the executable is called PLUS31), then goes to
DOS and tries there (and fails there). This is what causes the flash --
as usual, the screen is blanked when Windows goes to DOS.
Q. When I try to generate my menu, I get the error FRM-31633: Main menu <MAIN>
not found in module.
A. Every menu application denotes one of its menus as the starting (main)
menu. The menu application property Main denotes which of its menus to
use. In V4.0, select Menu -> Module to bring up the property sheet. In
V4.5, highlight the menu app in the Object Navigator and select Tools ->
Property Palette. This will allow you to see what Oracle Forms thinks the
main menu name is.
Once you know this, go back to the menu editor and make sure that you
have a menu named the same thing in your application. For V4.0 users,
if it seems that such a menu does exist, then click OK in the menu editor
to make sure that any pending changes have been applied, then try the
generation again.
Attaching Menus to Forms
===============================================================================
For a complete overview, step-by-step instructions, and debugging guide
for linking a form and a menu, please obtain the bulletin "Linking a Form
to a Menu" (106754.089)
Upgrading Menus From SQL*Menu V5.0
===============================================================================
For a complete overview, step-by-step instructions, and debugging guide
for menu upgrade questions, please obtain the bulletin "Upgrading Menu
Applications" (106754.004)