APP_SPECIAL: Menu and Toolbar Control

Use the APP_SPECIAL package to enable and customize menu entries and buttons on the toolbar.

See: Application-Specific Entries: Special Menus

APP_SPECIAL.INSTANTIATE

Summary
procedure APP_SPECIAL.INSTANTIATE(
          option_name       varchar2,
          hint varchar2     default null,
          icon varchar2     default null,
          initially_enabled boolean default true,
          separator         varchar2 default null);
Description

This call constructs the special menu according to your specifications. Call this function in the PRE-FORM trigger, after the call to APP_STANDARD.EVENT('PRE-FORM'). When the user chooses an entry on the special menus or presses a corresponding toolbar button, a user-named trigger with the same name as the function is executed.

Arguments (input)
option_name Pass SPECIAL1 to SPECIAL45 to indicate the slot on the special menus in which you want to put your function. SPECIAL1 is at the top of the first of the three special menus, and SPECIAL15 is at the bottom of the first special menu. SPECIAL16 is at the top of the second of the three special menus, and SPECIAL30 is at the bottom of the second special menu. SPECIAL31 is at the top of the third of the three special menus, and SPECIAL45 is at the bottom of the third special menu. When you instantiate any menu entry, the top level menu for the corresponding special menu is enabled.
Check boxes are available on the first special menu only. The check box entries provide a menu entry that includes a check box. Pass SPECIAL1_CHECKBOX to SPECIAL15_CHECKBOX (instead of the corresponding SPECIALn entry) to indicate the slot on the special menu in which you want to put your function. If you use the check box entries, you must also use the APP_SPECIAL.SET_CHECKBOX routine to set the initial value of the check box for the corresponding menu entry.
Pass SPECIAL, SPECIAL_B, or SPECIAL_C to explicitly control one of the three top-level special menus. SPECIAL is at the top of the first of the three special menus, SPECIAL_B is at the top of the second special menu, and SPECIAL_C is at the top of the third special menu. This is typically used to explicitly enable or disable a top-level entry.
hint Your menu item label. Pass a translated string (if your form is to be translated, you should define a message in Message Dictionary, retrieve the message first, and pass the retrieved message string to APP_SPECIAL). Include an '&' in the string to define which character becomes the shortcut key for that item (this is the same as the behavior in the Oracle Forms Form Builder. For example, '&Book Orders'). You can change the label for SPECIAL_B (Reports) or SPECIAL_C (Actions), but you cannot change the label of the SPECIAL menu (Tools). In addition, you cannot specify an access key for SPECIAL_B or SPECIAL_C.
icon If you want to include an iconic button on the toolbar for the function, give the name of the icon. Any of the SPECIAL1 through SPECIAL45 functions can include a corresponding toolbar button (though you should limit the number of extra icons on the toolbar for aesthetic reasons). If there is no corresponding toolbar button, pass NULL. SPECIALn_CHECKBOX entries cannot have icons on the toolbar.
For custom forms, the icon file must be a .gif file 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.
For Oracle Applications products, icon files are included in a .jar file included in the Oracle Applications installation.
initially_enabled A boolean value that lets you set the initial status of the menu item. If you do not want to enable the item when your application starts, pass FALSE. The default value is TRUE.
separator Pass 'LINE' to display a menu separator line above your menu entry. The LINE argument is ignored for SPECIAL1(_CHECKBOX), SPECIAL16, or SPECIAL31. The default is no line.
Example 1
APP_SPECIAL.INSTANTIATE('SPECIAL3','&Book Order', 'POBKORD', TRUE, 'LINE');
Example 2
app_special.instantiate('SPECIAL12_CHECKBOX',
                        'Specia&l 12 Check Box with Line',
                         separator=>'LINE'); 
app_special.set_checkbox('SPECIAL12_CHECKBOX','TRUE');  

results in a menu entry that looks like the following:

-----------------------------------
[x] Speciall 12 Check Box with Line

APP_SPECIAL.ENABLE

Summary
procedure APP_SPECIAL.ENABLE(
          option_name varchar2, 
			  state number);
Description

This call controls the enabling and disabling of the items in the menu, including the Special menu (and their corresponding toolbar buttons), allowing you to customize your menus for each block.

If a special function is available for most of the blocks in a form, create a form level PRE-BLOCK trigger that enables the function. For any block where this is not a valid function, code a block level PRE-BLOCK trigger with Execution Hierarchy set to Override that disables the function.

See: Menu and Toolbar Entries

Enable and disable SAVE to control the 'File->Save' and 'File->Save and Enter Next' menu entries. Save is automatically disabled when you call APP_FORM.QUERY_ONLY MODE.

Before entering a modal window that allows access to the menu, call APP_SPECIAL.ENABLE('MODAL', PROPERTY_OFF). When you leave the block, call ENABLE again with PROPERTY_ON. PROPERTY_OFF disables the menu items that are disallowed in a modal block.

You can control the availability of the ATTACHMENTS, TRANSLATION, SUMMARY/DETAIL, and SELECT_ALL menu entries.

Use the SINGLE option to disable the first record, last record, previous record, and next record options on the Go menu in a block with only one available record.

See: Single Record Blocks

Use the ABOUT option to disable the Help->Record History menu option.

Arguments (input)
option_name The name of the option to be enabled. Possible values include: ABOUT, ATTACHMENTS, MODAL, SAVE, SELECT_ALL, SINGLE, SPECIAL1, ...through SPECIAL45 (or SPECIALn_CHECKBOX entries), SPECIAL, SPECIAL_B, SPECIAL_C, SUMMARY/DETAIL, TRANSLATION, or the full name of any menu item. Setting SPECIAL to PROPERTY_OFF disables all special menu items.
state Either PROPERTY_ON or PROPERTY_OFF
Example
 APP_SPECIAL.ENABLE('SPECIAL3',PROPERTY_ON);

APP_SPECIAL.GET_CHECKBOX

Summary
function APP_SPECIAL.GET_CHECKBOX
         (option_name varchar2)
			  RETURN       varchar2;
Description

Use this procedure to get the current value of a check box in one of the special menus. Call this procedure within the trigger that gets executed by the check box entry on the first special menu. This function returns the state of the checkbox menu item as either the string 'TRUE' if the check box is checked or 'FALSE' if the check box is not checked. This call will result in an error if the menu entry does not exist.

Arguments (input)
option_name Pass SPECIAL1_CHECKBOX to SPECIAL45_CHECKBOX to indicate the special menu entry for which you want to get the value.
Example
 if (app_special.get_checkbox('SPECIAL3_CHECKBOX')='TRUE') then
            fnd_message.debug('Special 3 is True!'); 
    else
            fnd_message.debug('Special 3 is False!'); end if;

APP_SPECIAL.SET_CHECKBOX

Summary
procedure APP_SPECIAL.SET_CHECKBOX(
 		     option_name varchar2,
          new_value varchar2);
Description

Use this procedure to set the initial value of a check box in one of the special menus. Call this procedure after instantiating the corresponding check box menu entry on a special menu.

Arguments (input)
option_name Pass SPECIAL1_CHECKBOX to SPECIAL15_CHECKBOX to indicate the special menu entry for which you want to set the value.
new_value Pass the character string 'TRUE' to set the check box to checked or 'FALSE' to set the check box to unchecked.
Example
app_special.instantiate('SPECIAL3_CHECKBOX',
                         'Spe&cial 3 Box with Line',
                         '',TRUE,'LINE'); 
app_special.set_checkbox('SPECIAL3_CHECKBOX','TRUE'); 
app_special.instantiate('SPECIAL4_CHECKBOX',
                        'Special &4 Box'); 
app_special.set_checkbox('SPECIAL4_CHECKBOX','TRUE');