Special Triggers in the TEMPLATE form

The TEMPLATE form contains several form-level triggers that must exist in order for other routines to operate properly. Specific rules about modifications you can safely make to these triggers are discussed below.

Attention: Under no circumstances may any of these triggers be deleted.

The text within these triggers must remain within the trigger; however, frequently developers need to add text before or after this text. These triggers are listed below.

Warning: You must not change triggers that are referenced into the form, even though it is technically possible in Oracle Forms Developer. Changing referenced triggers may cause problems in your form or may cause problems for future upgrades.

Standard Forms Triggers

User-Named Triggers:

Triggers That Often Require Some Modification

ACCEPT

APP_STANDARD.EVENT('ACCEPT');

This trigger processes invocation of the "Action, Save and Proceed" menu choice or toolbar button. It saves and moves to the next record of the block specified as the First Navigation Block.

Replace the code in this trigger, or create block-level triggers with execution style 'Override'.

See: Save and Proceed

FOLDER_RETURN_ACTION

null;

This trigger allows customization of specific folder events.

Replace text with specific code needed to process folder actions.

Warning: Oracle does not support modifications to this trigger except for Oracle E-Business Suite internal use.

KEY-DUPREC

APP_STANDARD.EVENT('KEY-DUPREC');

This trigger disables the default duplicate record functionality of Oracle Forms.

To process the "Edit, Duplicate Record Above" menu choice properly, code a block-level KEY-DUPREC with execution style 'Override'. This trigger should perform a duplicate_record, then validate or clear fields as needed.

See: Duplicating Records

KEY-CLRFRM

APP_STANDARD.EVENT('KEY-CLRFRM');

This trigger validates the record before attempting to clear the form.

Add any additional code after the supplied text. Typically you would add GO_BLOCK calls if you have alternative regions in your form, where the GO_BLOCK calls repopulate your region control poplist after a Clear Form operation.

KEY-MENU

APP_STANDARD.EVENT('KEY-MENU');

This trigger disables the Block Menu command of Oracle Forms.

To enable operation of Alternative Regions via the keyboard from a specific block, code a block-level KEY-MENU with execution style 'Override'. This trigger should open an LOV with the same choices as the Alternative Region control poplist.

See: Alternative Regions

KEY-LISTVAL

APP_STANDARD.EVENT('KEY-LISTVAL');   

This trigger performs flexfield operations or LOV invocation.

Create block- or item-level triggers with execution style 'Override' on fields using the Calendar, or fields that dynamically invoke flexfields.

See: The Calendar

ON-ERROR

APP_STANDARD.EVENT('ON-ERROR');  

This trigger processes all errors, server or client side, using Message Dictionary calls.

To trap specific errors, check for your specific errors before the APP_STANDARD call.

declare
	   original_mess      varchar2(80);
	begin
    IF MESSAGE_CODE = <your message number> THEN
	      original_mess := MESSAGE_TYPE||'-'||
	         to_char(MESSAGE_CODE)||': '||MESSAGE_TEXT; 
     --- your code handling the error goes here
	     message(original_mess);
	   ELSE
	      APP_STANDARD.EVENT('ON_ERROR');
	   END IF
	end;  

See: Overview of Message Dictionary

APP_EXCEPTION: Exception Processing APIs

POST-FORM

APP_STANDARD.EVENT('POST-FORM');  

This trigger is reserved for future use.

Add any additional code before the supplied text.

PRE-FORM

FND_STANDARD.FORM_INFO('$Revision: 120.5 $', 
                   '<Form Name>', 
                   '<Application Shortname>', 
                   '$Date: 2010/05/20 19:35:22 $',
                   '$Author: appldev $');
APP_STANDARD.EVENT('PRE-FORM');  
APP_WINDOW.SET_WINDOW_POSITION('BLOCKNAME',
                   'FIRST_WINDOW');

This trigger initializes internal Oracle E-Business Suite values and the menu. The values you enter here are shown when you choose "Help, About Oracle Applications" from the Oracle E-Business Suite menu.

You must modify the application short name. The application short name controls which application's online help file is accessed when the user presses the window help button on the toolbar. If you leave the application short name as FND, your user will not see any help because Oracle E-Business Suite will not be able to construct a valid help target.

The form name is the user form name (form title). This is for your reference only, and is not used elsewhere.

Oracle uses a source control system that automatically updates the values beginning with "$". If you are not using that source control system, you can and should modify those values with your own development information.

You must also modify the APP_WINDOW call to use your own block name (of your first block) instead of BLOCKNAME. Do not modify the string FIRST_WINDOW.

See: Controlling Window Behavior

QUERY_FIND

APP_STANDARD.EVENT('QUERY_FIND');  

This trigger issues a default message stating that Query Find is not available.

Replace the code in this trigger, or create block-level triggers with execution style 'Override' when you create a Find window or Row-LOV in your form.

See: Query Find Windows

WHEN-NEW-FORM-INSTANCE

FDRCSID('$Header: DEV00007306.htm 120.5 2010/05/20 19:35:22 appldev ship $');
APP_STANDARD.EVENT('WHEN-NEW-FORM-INSTANCE');

-- app_folder.define_folder_block('template test',
    'folder_block', 'prompt_block', 'stacked_canvas',
    'window', 'disabled functions');
-- app_folder.event('VERIFY');

The APP_STANDARD.EVENT call in this trigger supports the query-only mode invoked by FND_FUNCTION.EXECUTE. The FDRCSID call supports the Oracle E-Business Suite source control system. The APP_FOLDER calls are for Oracle E-Business Suite internal use only. Custom forms do not require either the FDRCSID or the APP_FOLDER calls, but it does no harm to leave them in the trigger.

Add any additional code before the supplied text.

Warning: Oracle does not support modifications to the APP_FOLDER calls in this trigger except for Oracle E-Business Suite internal use.

WHEN-NEW-RECORD-INSTANCE

APP_STANDARD.EVENT('WHEN-NEW-RECORD-INSTANCE');  

This trigger manages the state of the Oracle E-Business Suite menu and toolbar.

Create block-level triggers as needed, with execution style 'Before'.

See: Synchronizing

WHEN-NEW-BLOCK-INSTANCE

APP_STANDARD.EVENT('WHEN-NEW-BLOCK-INSTANCE');

This trigger manages the state of the Oracle E-Business Suite menu and toolbar.

Create block-level triggers as needed, with execution style 'Before'.

See: Synchronizing

WHEN-NEW-ITEM-INSTANCE

APP_STANDARD.EVENT('WHEN-NEW-ITEM-INSTANCE');

This trigger manages the state of the Oracle E-Business Suite menu and toolbar.

If you add a flexfields routine call, you should add it before the APP_STANDARD.EVENT call. In general, you should not add any other code to this trigger, as such code would affect every item in the form and could hurt your form performance.

Create block-or item-level triggers as needed, with execution style 'Before'.

See: Synchronizing

Triggers That Cannot Be Modified

Oracle E-Business Suite does not support the modification of these form-level triggers in any way.

CLOSE_THIS_WINDOW

This trigger invokes APP_CUSTOM.CLOSE_WINDOW from the menu Action->Close Window.

CLOSE_WINDOW

APP_CUSTOM.CLOSE_WINDOW(:SYSTEM.EVENT_WINDOW);

This trigger processes all window close events. Code that processes the close window events must reside in the APP_CUSTOM.CLOSE_WINDOW package.

See: Controlling Window Behavior

EXPORT

app_standard.event('EXPORT');

This trigger processes invocation of the "Action, Export" menu choice.

FOLDER_ACTION

app_folder.event(:global.folder_action);

This trigger processes invocation of entries on the Folder menu.

KEY-COMMIT

APP_STANDARD.EVENT('KEY-COMMIT');

This trigger processes commits in normal or called forms.

Warning: Oracle strongly recommends against the use of called forms. This procedure supports them for backward compatibility only.

KEY-EDIT

APP_STANDARD.EVENT('KEY-EDIT');

This trigger performs flexfield operations, or Calendar or Editor invocation.

KEY-EXIT

APP_STANDARD.EVENT('KEY-EXIT');

This trigger processes Close events, and leaves enter-query mode.

KEY-HELP

APP_STANDARD.EVENT('KEY-HELP');

This trigger invokes the Window Help system.

LASTRECORD

APP_STANDARD.EVENT('LASTRECORD');

This trigger processes the menu event Go->Last Record.

MENU_TO_APPCORE

APP_STANDARD.EVENT(:global.menu_to_appcore);

This trigger supports the Special menu.

STANDARD_ATTACHMENTS

atchmt_api.invoke;

This trigger processes invocation of the Attachments menu entry or toolbar button.

WHEN-WINDOW-CLOSED

execute_trigger('CLOSE_WINDOW');

This trigger centralizes window close events from the Oracle E-Business Suite or Window Manager menu.

WHEN-FORM-NAVIGATE

You cannot modify this referenced trigger. It enables certain standard behaviors, such as normalizing a minimized form when it is navigated to.

To make use of this form event, populate a global variable called GLOBAL.WHEN_FORM_NAVIGATE with the name of a user-named trigger. Usually you populate this global immediately before issuing a GO_FORM.

See: Passing Instructions to a Form

ZOOM

appcore_custom.event('ZOOM');

This trigger processes invocation of the "Action, Zoom" menu choice or toolbar button.