| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to capture server error messages from "forms"
Here is a sampler from Forms 3.0 "LIBRAY" form which can then be referenced by all other forms.
DEFINE TRIGGER
NAME = on-error
TRIGGER_TYPE = V3
TEXT = <<<
/* ************** Reference from LIBRARY form LIB *************
*/
if error_code = 40102 then
/* FRM-40102 Record must be entered or deleted first. */
message('You tried to INSERT a record. Continue entering data
OR press DELETE RECORD Key.'); bell;
elsif error_code = 40200 then
/* FRM-40200 Field is protected against update. */
message('This field cannot be changed.'); fail;
elsif error_code = 40202 then
/* FRM-40202 Field must be entered. */
if :system.record_status in ('NEW', 'INSERT') then
message('This field is mandatory. Please enter data,
press DELETE RECORD Key or EXIT.');
else
message('This field is mandatory. Please enter data.');
end if;
fail;
elsif error_code = 40209 then
/* FRM-40209 Field must be of form <format mask>. */
if substr(error_text, 23,1) = 'D' then
message('Date must be in the format 01-JAN-1994. Also check
for proper day and month.');
elsif
instr(substr(error_text,1,length(error_text)-1),'"') > '0' then
message(error_type||'-'||to_char(error_code)||':'||error_text);
elsif
instr(substr(error_text,1,length(error_text)-1),'.') > '0' then
message('This field is numeric. Please re-enter in the format
'
||replace(substr(error_text,23), '0', '9') );
else
message('Date must be entered in proper format.');
end if;
fail;
elsif error_code = 40508 then
/* FRM-40508 Oracle error -- unable to INSERT record. */
message('You are not authorized to insert records in this form'||
' *** OR ***,Press ENTER key.'); bell; pause;
message('This record already exists in the database. Please press
DELETE RECORD key.'); fail;
elsif error_code = 40509 then
/* FRM-40509 Oracle error -- unable to UPDATE record. */
message('You are not authorized to update records in this form.
Contact System Support.'); fail;
elsif (error_code = 41003 or error_code = 41004) then
/* FRM-41003 This block does not correspond to a table. Function
ignored.*/
/* FRM-41004 Function key not allowed in this mode. */
message('This Function key is Invalid here.'); fail;
elsif error_code = 41802 then
/* FRM-41802 Duplicate Record function allowed on new records only.
*/
message('Duplicate Record function allowed on New records only.');
fail;
else
/* Provide for other messages. */
message(error_type||'-'||to_char(error_code)||':'||error_text);bell;
end if;
>>>
ENDDEFINE TRIGGER amparo ruiz <arc_at_uitesa.es> wrote in article <357fe485.253177192_at_noticias.ibernet.es>...
> I'd like to know how may I capture error messages generated in an > Oracle server from a "forms" aplication. > > Any help will be welcome. > > thanks, > >Received on Wed Jun 17 1998 - 00:00:00 CDT
![]() |
![]() |