The Oracle Applications pulldown menus (the default menu) allow the user to invoke standard Oracle Forms functions, such as "Clear Record" as well as application-specific functions.
Both the menu and the toolbar are included in the TEMPLATE form. Entries on the menu and the toolbar are disabled and enabled automatically based on the current context.
For details on each pulldown menu and iconic button on the Toolbar,, see the Oracle Applications User Interface Standards for Forms-Based Products.
Your menu and toolbar should react consistently to changes within your forms. Unless specified otherwise, the following behaviors come automatically from the form-level triggers embedded in your forms. The triggers that control the behavior appear with each entry (if applicable).
In order as they appear on the toolbar:
New (Record) (WHEN-NEW-BLOCK-INSTANCE)
Enabled if the block allows inserts.
Find... (WHEN-NEW-RECORD-INSTANCE)
Enabled if the block allows querying and is not already in enter-query mode.
Show Navigator (WHEN-NEW-RECORD-INSTANCE)
Enabled except in called forms.
Save
Always enabled.
Next Step
Print...
Always enabled.
Close Form
Cut/Copy/Paste
These menu and toolbar items are processed by Oracle Forms
Clear Record
Always enabled.
Delete Record (corresponds to Edit, Delete on menu) (WHEN-NEW-RECORD-INSTANCE)
Enabled if the block allows deletes.
Edit Field... (WHEN-NEW-ITEM-INSTANCE)
Enabled when the current item is a text item.
Zoom (WHEN-NEW-BLOCK-INSTANCE)
Enabled if the customer defines a zoom for the current block
Translations
Disabled by default; developer can enable/disable as required using APP_SPECIAL.ENABLE.
Attachments (WHEN-NEW-RECORD-INSTANCE and WHEN-NEW-BLOCK-INSTANCE)
The icon is set, and attachment entry is enabled or disabled based on the existence of attachment definitions and actual attachments.
Folder Tools
Enabled if the cursor is in a folder block; developer must provide code in a combination folder block.
Window Help
Always enabled.
In order as shown on the pulldown menu, from File to Help:
Clear Form
Always enabled
Summary/Detail
Disabled by default; developer can enable/disable as required using APP_SPECIAL.ENABLE.
Save and Proceed
Always enabled.
File, Exit Oracle Applications (WHEN-NEW-RECORD-INSTANCE)
Enabled if not in enter-query mode.
Edit, Duplicate, Field Above (WHEN-NEW-ITEM-INSTANCE)
Enabled if the current record number is > 1.
Edit, Duplicate, Record Above (WHEN-NEW-RECORD-INSTANCE)
Enabled if the current record number is > 1 and the record status is 'NEW'. The developer must customize Duplicate Record behavior in the form- or block-level KEY-DUPREC trigger.
Edit, Clear, Field (WHEN-NEW-ITEM-INSTANCE)
Enabled when the current item is a text item.
Edit, Clear, Block (WHEN-NEW-ITEM-INSTANCE)
Always enabled.
Edit, Clear, Form (WHEN-NEW-ITEM-INSTANCE)
Always enabled.
Edit, Select All
Edit, Deselect All
Edit, Preferences, Change Password
Edit, Preferences, Profiles
View, Find All (WHEN-NEW-RECORD-INSTANCE)
Enabled if the block allows querying, and not already in enter-query mode.
View, Query by Example, Enter (WHEN-NEW-BLOCK-INSTANCE)
Enabled if the block allows querying.
View, Query by Example, Run (WHEN-NEW-BLOCK-INSTANCE)
Enabled if the block allows querying.
View, Query by Example, Cancel (WHEN-NEW-RECORD-INSTANCE)
Enabled if in enter-query mode.
View, Query by Example, Show Last Criteria (WHEN-NEW-RECORD-INSTANCE)
Enabled if in enter-query mode.
View, Query by Example, Count Matching Records (WHEN-NEW-RECORD-INSTANCE)
Enabled if the block allows querying.
View, Record, First
Enabled if the current record number is > 1.
View, Record, Last
Enabled if the current record number is > 1.
View, Requests
Window, Cascade
Window, Tile Horizontally
Window, Tile Vertically
Help, Oracle Applications Library
Help, Keyboard Help
Help, Diagnostics
The entire Diagnostics menu can be controlled using the profile option Hide Diagnostics Menu Entry.
Help, Diagnostics, Display Database Error
Help, Diagnostics, Examine
Help, Diagnostics, Test Web Agent
Help, Diagnostics, Trace
Help, Diagnostics, Debug
Help, Diagnostics, Properties, Item
Help, Diagnostics, Properties, Folder
Help, Diagnostics, Custom Code, Normal
Help, Diagnostics, Custom Code, Off
Help, Record History
Enabled if the current block has a base table or view. Disable this menu option if the underlying table has no WHO columns.
Help, About Oracle Applications
You can use the APP_SPECIAL.ENABLE procedure to dynamically control menu items, if the behavior you need is not provided automatically. First, determine if the default menu control handles the menu item in question, and ensure that there really is a need to override the default behaviors.
If the menu item is not controlled by the default menu control, use any appropriate trigger (typically PRE-BLOCK or WHEN-NEW-BLOCK-INSTANCE), adding the code:
app_special.enable('the menu item', PROPERTY_OFF|ON);
Turn the menu item back on when you leave (typically POST-BLOCK) by calling:
app_special.enable('the menu item', PROPERTY_ON|OFF);
Include the full name of the menu item in this call, for example:
app_special.enable('CLEAR.FIELD', PROPERTY_OFF);
You can determine the full names of the menu items by copying FNDMENU from the AU_TOP/resource/<language> area and opening the copy to examine the menu items.
If the menu item is controlled by the default menu control and you want to modify its behavior (enable or disable it), create the field- or block-level trigger listed (either WHEN-NEW-BLOCK-INSTANCE, WHEN-NEW-RECORD- INSTANCE, or WHEN-NEW-ITEM- INSTANCE). Set the trigger Execution Hierarchy to "Override" and add the following code:
app_standard.event('TRIGGER_NAME');
app_special.enable('Menu_item', PROPERTY_OFF|ON);
The item will be correctly reset in other blocks by the default menu control, so it is not necessary to reset it when leaving the block, record, or item.
See: APP_SPECIAL: Menu and Toolbar Control
The most common sources of problems with menu include the following coding mistakes:
A trigger at the item or block level that has the Execution Hierarchy set to Before but whose logic is then reset by the form-level APP_STANDARD.EVENT( ) call
A trigger at the item or block level that has the Execution Hierarchy set to Override but that does not include the APP_STANDARD.EVENT( ) call before the additional logic
Incorrect settings for the block-level properties Query Allowed, Delete Allowed, Insert Allowed, and so on. If at any time you need to change a property and need to force a refresh of the menu (because the appropriate WHEN- trigger will not fire after the change you made), call APP_STANDARD.SYNCHRONIZE.
Control blocks that list a Base Table (instead of no table as the base table)
You may want to disable some menu options for blocks in which only one record is possible. The Single Record Blocks section discusses when and how to do this.
See: Single Record Blocks
By default, this function performs a Save, then moves to the First Navigation Data Block of the form and proceeds to the next record. You can override this behavior.
Replace the code within the form-level ACCEPT trigger, or create a block-level ACCEPT trigger with Execution Hierarchy set to Override that calls any of the following:
APP_STANDARD.EVENT('ACCEPT') to get the default behavior
APP_STANDARD.EVENT('ACCEPT:0') to get the default behavior, except that the cursor does not change blocks
APP_STANDARD.EVENT('ACCEPT:<blockname>') to get default behavior except the cursor moves to the specified block
or any other code that is appropriate for your form
The toolbar and menu are automatically updated by the standard form-level WHEN-NEW-RECORD-INSTANCE, WHEN-NEW- BLOCK-INSTANCE, and WHEN-NEW-ITEM-INSTANCE triggers. If you change a property of a block or an item, the menu and toolbar do not reflect this change until the appropriate trigger fires.
For example, if you turn the block property Insert Allowed off on a block while the cursor is already in that block, you must explicitly call the routine below to synchronize the menu and the toolbar:
APP_STANDARD.SYNCHRONIZE;
See: APP_STANDARD Package.
You can customize the menu to display application-specific values. The menu supports up to forty-five application-specific entries under three top-level special menu entries (usually called Tools, Reports, and Actions). The toolbar supports corresponding iconic buttons for any of the forty-five special menu entries.
Any icon placed on the toolbar must be approved by the User Interface Standards group, and will be maintained with all the other icons.
See: APP_SPECIAL: Menu and Toolbar Control
Suppose you have a special function called 'Book Order' that you want to add to the menu and the toolbar. To add 'Book Order' as the first entry on the first special menu (Tools) and as an icon on the toolbar, such that they are only available in the 'Header' block of a form, do the following:
Modify the form level PRE-FORM trigger:
PRE-FORM
app_special.instantiate('SPECIAL1', '&Book Order', 'bkord');
If you plan to translate your form, you should use Message Dictionary, a parameter, or a static record group cell to store the Special Menu entry. You then retrieve the value (which is translated when the application is translated) into a variable and pass the variable to the APP_SPECIAL routine. For example:
app_special.instantiate('SPECIAL1', my_menu_entry, 'bkord');
Add a form-level PRE-BLOCK trigger:
PRE-BLOCK
app_special.enable('SPECIAL1',PROPERTY_OFF);
Add a block level PRE-BLOCK trigger to the block in which you want to enable your special menu entries:
PRE-BLOCK in HEADER block
app_special.enable('SPECIAL1',PROPERTY_ON);
Add a block level SPECIAL1 user-named trigger that contains code to actually perform your 'Book Order' function. It executes when the user chooses this menu entry.
For custom forms, custom icon files must be separate standard .gif files located in the directory designated by the OA_MEDIA virtual directory (see your web server administrator for this information). Note that retrieving the icon file for a custom icon requires a round trip to the forms server, so you should limit the number of icons you retrieve if performance becomes an issue.
Any Oracle Applications icon placed on the toolbar must be approved by the Standards group, and will be maintained with all the other icons in the appropriate .jar file.
To disable all special menu entries (for example, when entering query-mode), call APP_SPECIAL.ENABLE('SPECIAL', PROPERTY_OFF);
Oracle Applications provides default right-mouse menu functionality for all text items. When a user presses the right mouse button (or equivalent "secondary" button) while holding the mouse pointer over the text item that currently has cursor focus, Oracle Applications displays a context-sensitive popup menu. The default menu entries are:
Cut Copy Paste ------ Folder ------ Help
You can customize the right-mouse menus to display application-specific entries in addition to the default entries. The right-mouse menu supports up to ten application-specific entries. Application-specific entries appear between the Folder and Help Entries (and separator lines). You can include separator lines among your entries. For example:
Cut Copy Paste ------------ Folder ------------ First Entry Second Entry ------------ Third Entry ------------ Help
APP_POPUP: Right-Mouse Menu Control
Adding entries to right-mouse menus requires at least two triggers in your form for each entry. The first trigger is the PRE-POPUP-MENU, which can be at block or item level depending on the desired behavior. The PRE-POPUP-MENU trigger calls the APP_POPUP.INSTANTIATE routine to set up the menu entry. This call includes the name, POPUP1 through POPUP10, of the menu entry function. Set the Execution Hierarchy of your trigger to After so your trigger fires after the form-level PRE-POPUP-MENU trigger (which must fire first to check that the user clicked over the field that currently has focus and to set the menu to its default state).
The second trigger is a corresponding user-named trigger called POPUP1 through POPUP10, typically at the block or item level, that contains the functionality you want to execute when a user selects your menu entry. Note that the popup menu entries appear, and if chosen will execute, even if the field is currently disabled, so if your logic should not execute when the field is disabled, you must test for that in your code.
Suppose you have a special function called "Approve" that you want to add to the right-mouse menu. To add Approve as the first custom entry on the right-mouse menu, such that it is only available in the Requisition Number field of a form, do the following:
Modify the item-level PRE-POPUP-MENU trigger on the Requisition Number field. Be sure to set the trigger Execution Hierarchy to After.
app_popup.instantiate('POPUP1', 'Approve');
If you plan to translate your form, you should use Message Dictionary, a parameter, or a static record group cell to store the Special Menu entry. You then retrieve the value (which is translated when the application is translated) into a variable and pass the variable to the APP_SPECIAL routine. For example:
app_special.instantiate('POPUP1', my_menu_entry);
Add a field level POPUP1 user-named trigger that contains code to actually perform your "Approve" function. It executes when the user chooses this menu entry.