Friday, May 24, 2013

Form Level Application Triggers and its Scope

SL NO NAME At Form Level
1 ON-COMMIT Description:Fires whenever Oracle Forms would normally issue a database commit statement to finalize a transaction. By default, this operation occurs after all records that have been marked as updates, inserts, and deletes have been posted to the database. The default COMMIT statement that Oracle Forms issues to finalize a transaction during the Post and Commit Transactions process.
Usage: Use an On-Commit trigger to change the conditions of normal Oracle Forms commit processing to fit the particular requirements of a commit to a non-ORACLE database.
On Failure : Aborts Post and Commit processing
Fires In : Post and Commit Transactions
On-Commit Trigger Example:
 This example disables the commit operation when running against a datasource that does not support transaction control. If the application is running against ORACLE, the commit operation behaves normally.
BEGIN
IF Get_Application_Property(DATA_SOURCE) = 'ORACLE' THEN
Commit_Form;
 ELSIF form_fatal OR form_failure THEN
raise form_trigger_failure;
END IF; /* ** Otherwise, no action is performed */ END; 
/*******END OF SL 1 **************/
2 ON-LOGON Description:Fires once for each logon when Oracle Forms normally initiates the logon sequence.
Enter Query Mode no
Usage Notes : Use an On-Logon trigger to initiate a logon procedure to a non-ORACLE data source. Pre-Logon and Post-Logon triggers fire as part of the logon procedure. To create an application that does not require a data source, supply a NULL command to this trigger to bypass the connection to a data source. To perform the default Oracle Forms processing from this trigger, include a call to the LOGON built-in.
On Failure : Oracle Forms attempts to exit the form gracefully, and does not fire the Post-Logon trigger.
/*******END OF SL 2 **************/
3 ON-LOGOUT Description: Fires when Oracle Forms normally initiates a logout procedure from Oracle Forms and from the RDBMS.
/*******END OF SL 3 **************/
4 ON-ROLLBACK Description:Fires when Oracle Forms would normally issue a ROLLBACK statement, to roll back a transaction to the last savepoint that was issued.
/*******END OF SL 4 **************/
5 ON-SAVEPOINT
Description:
Fires when Oracle Forms would normally issue a Savepoint statement. By default, Oracle Forms issues savepoints at form startup, and at the start of each Post and Commit Transaction process.
Fires In :
CALL_FORM
Post and Commit Transactions
SAVEPOINT
/*******END OF SL 5 **************/
6 POST-DATABASE-COMMIT Description: Fires once during the Post and Commit Transactions process, after the database commit occurs. Note that the Post-Forms-Commit trigger fires after inserts, updates, and deletes have been posted to the database, but before the transaction has been finalized by issuing the Commit. The Post-Database-Commit Trigger fires after Oracle Forms issues the Commit to finalize the transaction.  it fires later , first post-forms-commit fires.
/*******END OF SL 6 **************/
7 POST-FORM Description:Fires during the Leave the Form process, when a form is exited.
Usage Notes:
Use a Post-Form trigger for the following tasks: To clean up the form before exiting.
For example, use a Post-Form trigger to erase any global variables that the form no longer requires.
To display a message to the operator upon form exit.
This trigger does not fire when the form is exited abnormally, for example, if validation fails in the form.
/*******END OF SL 7 **************/
8 POST-FORMS-COMMIT Description:Fires once during the Post and Commit Transactions process. If there are records in the form that have been marked as inserts, updates, or deletes, the Post-Forms-Commit trigger fires after these changes have been written to the database but before Oracle Forms issues the database Commit to finalize the transaction.
If the operator or the application initiates a Commit when there are no records in the form have been marked as inserts, updates, or deletes, Oracle Forms fires the Post-Forms-Commit trigger immediately, without posting changes to the database.
Enter Query Mode no
Usage Notes: Use a Post-Forms-Commit trigger to perform an action, such as updating an audit trail, anytime a database commit is about to occur.
On failure : Aborts post and commit processing: Oracle Forms issues a ROLLBACK and decrements the internal Savepoint counter.
Fires in : Post and Commit Transactions
/*******END OF SL 8 **************/
9 PRE-COMMIT Description:Fires once during the Post and Commit Transactions process, before Oracle Forms processes any records to change. Specifically, it fires after Oracle Forms determines that there are inserts, updates, or deletions in the form to post or commit, but before it commits the changes. The trigger does not fire when there is an attempt to commit, but validation determines that there are no changed records in the form. Pre-Commit does fire in case of Post when there is no change in the form, but there are uncommited changes in the database.

Usage :
Use a Pre-Commit trigger to perform an action, such as setting up special locking requirements, at any time a database commit is going to occur.
On Failure :
The Post and Commit process fails: No records are written to the database and focus remains in the current item.
/*******END OF SL 9 **************/
10 PRE-FORM
Description
: Fires during the Enter the Form event, at form startup, before Forms navigates to the first navigable block of that form.
Enter Query Mode no
Use a Pre-Form trigger to perform the following tasks:
1)assign unique primary key from sequence
2)restrict access to a form
 3)initialize global variables

On Failure : Oracle Forms leaves the current form and fires no other trigger.
Fires In : Enter the Form
/*******END OF SL 10 **************/

11 PRE-LOGON Description: Fires just before Oracle Forms initiates a logon procedure to the data source.
Enter Query Mode no
Usage : Use a Pre-Logon trigger to prepare the form for the logon procedure, particularly to a non-ORACLE data source.
On Failure : The results of a failure depend on which of the following conditions applies:
If Oracle Forms is entering the form for the first time and the trigger fails, the form is exited gracefully, but no other triggers are fired.
If the trigger fails while Oracle Forms is attempting to execute the LOGON built-in from within the trigger, Oracle Forms raises the FORM_TRIGGER_FAILURE exception.
/*******END OF SL 11 **************/
12 PRE-LOGOUT Description:Fires once before Oracle Forms initiates a logout procedure.
Usage : Use a Pre-Logout trigger to prepare the form for logging out from the data source, particularly a non-ORACLE data source.
If you call certain built-ins from within one of the Logout triggers, the results are undefined. For example, the COPY built-in cannot be called from a Pre-Logout trigger because Pre-Logout fires after the Leave the Form event. Because the form is no longer accessible at this point, the COPY operation is not possible.

On Failure
: The results of a failure depend on which of the following conditions applies:
If Oracle Forms is exiting the form and the trigger fails, the form is exited gracefully, but no other triggers are fired.
If the trigger fails while Oracle Forms is attempting to execute the LOGOUT built-in from within the trigger, Oracle Forms raises the FORM_TRIGGER_FAILURE exception.
If an exception is raised in a Pre-Logout trigger, Oracle Forms does not fire other triggers, such as On-Logout and Post-Logout .
Fires in : LOGOUT
/*******END OF SL 12 **************/
13 WHEN-FORM-NAVIGATE Description: Fires when navigation between forms takes place, such as when the user changes the focus to another loaded form.
Enter Query Mode: No
Usage Notes: Use a When-Form-Navigate trigger to perform actions when any cross form navigation takes place without relying on window activate and window deactivate events.
On Failure
: No effect.
When-Form-Navigate Trigger Example:
DECLARE
win_id WINDOW := FIND_WINDOW('WINDOW12');
BEGIN
if (GET_WINDOW_PROPERTY(win_id,WINDOW_STATE) = 'MAXIMIZE' THEN
SET_WINDOW_PROPERTY(win_id,WINDOW_STATE,MINIMIZE);
else
SET_WINDOW_PROPERTY(win_id,WINDOW_STATE,MAXIMIZE);
end if;
END
/*******END OF SL 13 **************/
14 WHEN-NEW-FORM-INSTANCE

Description: At form start-up, Oracle Forms navigates to the first navigable item in the first navigable block. A When-New-Form-Instance trigger fires after the successful completion of any navigational triggers that fire during the initial navigation sequence.

This trigger does not fire when control returns to a calling form from a called form.
In a multiple-form application, this trigger does not fire when focus changes from one form to another.
On Failure : No effect.
Fires in : Run the form
When-New-Form-Instance Trigger Restrictions : When a new form is called, it will appear in the default x-y position on the screen. If this is not the desired position, you can change the x-y coordinates. However, they cannot be changed in this When-New-Form-Instance trigger. (This trigger fires too late in the sequence.) To change the coordinates, use the Pre-Form trigger.

Example:
BEGIN
Populate_Dynamic_Boilerplate;
Start_OnScreen_Clock_Timer;
Go_Block('EMP');
/*
** Query the block without showing
** the working message.
*/
:System.Suppress_Working := 'TRUE';
Execute_Query;
:System.Suppress_Working := 'FALSE';
END;

/*******END OF SL 14 **************/
15 WHEN-TAB-PAGE-CHANGED

Description:
Fires whenever there is explicit item or mouse navigation from one tab page to another in a tab canvas.
Enter Query Mode no
Usage Notes :
Use a When-Tab-Page-Changed trigger to perform actions when any tab page is changed during item or mouse navigation.
When-Tab-Page-Changed fires only when tab page navigation is explicit; it does not respond to implicit navigation. For example, the trigger will fire when the mouse or keyboard is used to navigate between tab pages, but the trigger will not fire if an end user presses [Next Item] (Tab) to navigate from one field to another field in the same block, but on different tab pages.
When-Tab-Page-Changed does not fire when the tab page is changed programmatically.
On Failure :  no effect.
/*******END OF SL 15 **************/
16 WHEN-TIMER-EXPIRED Description: Fires when a timer expires.
Usage NotesTimers are created programmatically by calling the CREATE_TIMER built-in procedure.
The When-Timer-Expired trigger can not fire during trigger, navigation, or transaction processing.
Use a When-Timer-Expired trigger to initiate an event, update item values, or perform any task that should occur after a specified interval.
You can call GET_APPLICATION_PROPERTY(TIMER_NAME) in a When-Timer-Expired trigger to determine the name of the most recently expired timer.
On failure :  No effect
Fires In : Process Expired Timer
When-Timer-Expired Trigger Restrictions : A When-Timer-Expired trigger will not fire when the user is currently navigating a menu.
/*******END OF SL 16 **************/
17 WHEN-WINDOW-ACTIVATED Description:
Fires when a window is made the active window. This occurs at form startup and whenever a different window is given focus. Note that on some window managers, a window can be activated by clicking on its title bar. This operation is independent of navigation to an item in the window. Thus, navigating to an item in a different window always activates that window, but window activation can also occur independently of navigation.
Enter Query Mode yes
Usage Notes : Use this trigger to perform the following types of tasks.
1)Capture initial settings of window properties, by way of the GET_WINDOW_PROPERTY built-in.
2)Enforce navigation to a particular item whenever a window is activated.
3)Keep track of the most recently fired window trigger by assigning the value from SYSTEM.EVENT_WINDOW to a variable or global variable.
On failure : No effect.
/*******END OF SL 17 **************/
18 WHEN-WINDOW-CLOSED Description:
Fires when an operator closes a window using a window-manager specific Close command.
Enter Query Mode yes
Usage Notes : Use this trigger to programmatically close a window when the operator issues the window-manager Close command.
You can hide the window that contains the current item.
On failure : no effect
Example : The following example of a call to SET_WINDOW_PROPERTY from this trigger closes a window whenever the operator closes it by way of the window manager operation:
Set_Window_Property('window_name', VISIBLE, PROPERTY_OFF);
/*******END OF SL 18 **************/
19 WHEN-WINDOW-DEACTIVATED DescriptionFires when an operator deactivates a window by setting the input focus to another window within the same form.
Enter Query Mode yes
Usage Notes :
Use this trigger to audit the state of a window whenever the operator deactivates the window by setting the input focus in another window.
Note that if this form opens another form, this deactivate trigger does not immediately fire. Instead, it will fire later when control returns to this form. (Assuming this window also has an activate trigger, then when control returns to this form, first the deactivate trigger fires followed immediately by the activate trigger.)
/*******END OF SL 19 **************/
20 WHEN-WINDOW-RESIZED Description: Fires when a window is resized, either by the operator or programmatically through a call to RESIZE_WINDOW or SET_WINDOW_PROPERTY. (Even if the window is not currently displayed, resizing the window programmatically fires the When-Window-Resized trigger.) This trigger also fires at form startup, when the root window is first drawn. It does not fire when a window is iconified.
Enter Query Mode yes
Usage Notes :
Use this trigger to perform any one of the following types of tasks:
a )Capture the changed window properties, such as width, height, x coordinate, or y coordinate.
b) Audit the actions of an operator.
c) Set the input focus in an item on the target window.
d) Maintain certain visual standards by resetting window size if the window was improperly resized.
/*******END OF SL 20 **************/

No comments:

Post a Comment