Home » Developer & Programmer » JDeveloper, Java & XML » Built-in Alert in 6i
Built-in Alert in 6i [message #139421] Tue, 27 September 2005 23:37 Go to next message
vsharmac
Messages: 16
Registered: July 2005
Junior Member
Hi,

Can someone tell me if there is any way i could modify the Built-in Alert message. If Yes then how?

For Example: When 2 users are trying to modify the same record at the same time then this error message is displayed:

"FRM-40501: ORACLE error:unable to reserve record for update or delete."

Just before this error message is shown, there is a built in alert which says

"Could not reserve record(2tries). Keep trying"

I want to modify this alert so that it is more user friendly in forms 6i. Is there any way i could do so. Iam working on database 9i and forms 6i

Pliz do reply,
Thanks
vsharma
Re: Built-in Alert in 6i [message #139429 is a reply to message #139421] Wed, 28 September 2005 00:33 Go to previous messageGo to next message
Scott B. Lindgren
Messages: 3
Registered: June 2004
Junior Member
vsharma;

We create two triggers in a Template and then subclass them into all the forms. All our clients do not like the error messages from Oracle so we capture them before hand and put out our own messages. Here is an example of the ON-ERROR trigger in our Templates:

DECLARE

IT_ID ITEM;
WORK_ERROR_CODE NUMBER(5);

BEGIN

WORK_ERROR_CODE := ERROR_CODE;
IF ERROR_TYPE = 'FRM' AND ERROR_CODE != 40401 THEN
IF ERROR_CODE = 40350 OR ERROR_CODE = 40202 OR
ERROR_CODE = 41042 OR ERROR_CODE = 40102 OR
ERROR_CODE = 40106 OR ERROR_CODE = 40212 OR
ERROR_CODE = 50016 OR ERROR_CODE = 41051 OR
ERROR_CODE = 41332 OR ERROR_CODE = 40400 OR
ERROR_CODE = 40602
or error_code = 41835 -- tab canvas error
then null;
ELSIF ERROR_CODE = 40735 OR ERROR_CODE = 40209 THEN
IT_ID := FIND_ITEM(:SYSTEM.TRIGGER_ITEM);
IF GET_ITEM_PROPERTY(IT_ID, DATATYPE) = 'CHAR' THEN
ERROR_MSG(44);
ELSIF GET_ITEM_PROPERTY(IT_ID, DATATYPE) = 'NUMBER' THEN
:GLOBAL.VAL_ERR := 'Y';
ERROR_MSG(60);
ELSE
ERROR_MSG(45);
END IF;
ELSIF ERROR_CODE = 40203 THEN
ERROR_MSG(46);
ELSIF ERROR_CODE = 40510 THEN
IF :GLOBAL.DEL_LOGIC = 'Y' THEN
:GLOBAL.DEL_LOGIC := 'N';
NULL;
ELSE
ERROR_MSG(47);
END IF;
ELSE
MESSAGE (ERROR_TYPE||'-'||TO_CHAR(ERROR_CODE)||' '||ERROR_TEXT);
END IF;
END IF;

END;

Then we also have a ON-MESSAGE trigger that is as follows:

DECLARE

WORK_ERROR_CODE NUMBER(5);

BEGIN
WORK_ERROR_CODE := MESSAGE_CODE;
IF MESSAGE_CODE = 40350 THEN
NULL;
ELSIF MESSAGE_CODE = 40735 THEN
MESSAGE ('Invalid value enter, not on table');
ELSIF MESSAGE_CODE = 40400 THEN
MESSAGE ('Record Successfully Updated');
ELSE
MESSAGE ('FRM-'||TO_CHAR(MESSAGE_CODE)||' '||MESSAGE_TEXT);
END IF;
END;

Hope this helps.....

Regards,

Scott B. Lindgren
SL Systems Technology, Inc.
slingren@sisna.com
Re: Built-in Alert in 6i [message #139474 is a reply to message #139429] Wed, 28 September 2005 03:47 Go to previous message
vsharmac
Messages: 16
Registered: July 2005
Junior Member
Hi,

This works with error message where the Error_Code is known.
You can change the message as u want.

But for this alert i don't know the name or the Alert_ID as this is automatically generated by the system.

Is it possible to change this Alert.

thanks,
vsharma
Previous Topic: Please help.... I am getting java.lang.ClassCastException: sun.jdbc.odbc.JdbcOdbcCallableStatement
Next Topic: Statements fail after reusing with addBatch
Goto Forum:
  


Current Time: Fri Apr 26 18:42:21 CDT 2024