A script-enabled browser is required for this page to function properly.

On-Message Trigger

Description

Fires whenever Oracle Forms would normally cause a message to display and pre-empts the message.

Definition Level form, block, or item

Legal Commands

SELECT statements, unrestricted Built-ins

Enter Query Mode yes

Usage Notes

Use an On-Message trigger for the following purposes:

On Failure

no effect

Restriction

On-Message Trigger Examples

The following example responds to an error message by displaying an alert that gives the user a message and gives the user the choice to continue or to stop:

DECLARE
alert_button NUMBER;
lv_errtype VARCHAR2(3) := MESSAGE_TYPE;
lv_errcod NUMBER := MESSAGE_CODE;
lv_errtxt VARCHAR2(80) := MESSAGE_TEXT;
BEGIN
IF lv_errcod = 40350 THEN
alert_button := Show_Alert('continue_alert');
IF alert_button = ALERT_BUTTON1 THEN
...
ELSE
...
END IF;
ELSE
Message(lv_errtyp||'-'||to_char(lv_errcod)||': '||lv_errtxt);
RAISE Form_Trigger_Failure;
END IF;
IF form_fatal OR form_failure THEN
raise form_trigger_failure;
END IF;

END;