Returns a message number for the message that Oracle Forms most recently generated during the current Runform session. MESSAGE_CODE returns zero at the beginning of a session, before Oracle Forms generates any messages.
Use MESSAGE_CODE to test the outcome of a user action (e.g., pressing a key) to determine processing within an On-Message trigger.
Refer to the Messages appendix for a list of messages and message numbers.
FUNCTION MESSAGE_CODE;
Built-in Type unrestricted function
Returns NUMBER
Enter Query Mode yes
none
/*
** Built-in: MESSAGE_CODE,MESSAGE_TEXT,MESSAGE_TYPE
** Example: Reword certain FRM message messages by checking
** the Message_Code in an ON-MESSAGE trigger
** Trigger: On-Message
*/
DECLARE
msgnum NUMBER := MESSAGE_CODE;
msgtxt VARCHAR2(80) := MESSAGE_TEXT;
msgtyp VARCHAR2(3) := MESSAGE_TYPE;
BEGIN
IF msgnum = 40400 THEN
Message('Your changes have been made permanent.');
ELSIF msgnum = 40401 THEN
Message('You have no unsaved changes outstanding.');
ELSE
/*
** Print the Normal Message that would have appeared
**
** FRM-12345: Message Text Goes Here
*/
Message(msgtyp||'-'||TO_CHAR(msgnum)||': '||msgtxt);
END IF;
END;