Press "Enter" to skip to content

Customize Default Oracle Form’s Messages Using On-Message Trigger

There are lot of messages which Oracle Forms used to show on particular event. Like when we save any transactions in Oracle Forms then it shows the message “Transaction complete: (n) Records applied and saved.” with message code 40400. You can customize these default Oracle Form’s messages using ON-MESSAGE trigger in Oracle Forms. Below I am giving an example for this.

What you need to do is just note down the message code from the Oracle Form’s status bar for which you want to customize the message and write the On-Message trigger at form level to display custom message, as shown in below example, which will show the “Transaction complete: (n) Records applied and saved.” by omitting number of records from the message.

DECLARE
 vabutton NUMBER;
BEGIN
 IF MESSAGE_CODE = 40400
 THEN
 SET_ALERT_PROPERTY ('noinfo',
 title,
 'Message ' || LTRIM (TO_CHAR (MESSAGE_CODE)));
 SET_ALERT_PROPERTY ('noinfo',
 alert_message_text,
 'Transaction complete: Records applied and saved.');
 vabutton := SHOW_ALERT ('noinfo');
 END IF;
END;

I used an Alert to show the message, which you can change by simply showing with Message() command. You can also put the Null command inside if to not show any message for this particular message code.