Forms Suppress Error Message And Catch frm-40350 Forms Suppress Error Message And Catch frm-40350 oracle oracle

Forms Suppress Error Message And Catch frm-40350


You can use the On-Message or On-Error trigger to trap any internal forms message or error. FRM-40350 is classified as type informative (can be checked in Forms help) so it has to be handled in On-Message trigger. The code for trapping the message should be something like this:

IF message_code = 40350 THEN  Message('Your custom message');ELSE  Message(message_type||'-'||TO_CHAR(message_code)||':'||message_text);END IF;

Please notice that 'On' triggers replaces implicit form functionality so if you in the example leave out the ELSE statement then you will hide all other forms messages! With the On-Error trigger it is essential that you remember to use RAISe after displaying your own message otherwise forms will continue as the error never had happened!

IF error_code = 50026 THEN    Message('My Own message');  RAISE FORM_TRIGGER_FAILURE;ELSE   Message(error_type||'-'||TO_CHAR(error_code)||':'||error_text);  RAISE FORM_TRIGGER_FAILURE;END IF;


You can use system.message_level to suppress messages from the system:You have levels of messages: 0, 5, 10, 15, 20, 25, >25

In a trigger, you can specify that only messages above a specified severity level are to beissuedby the form. You do this by assigning a value to the MESSAGE_LEVEL

example:

declare  old_message_level number;begin  :old_message_level := :system.message_level;  :system.message_level := 20; -- suppresses most errors  commit; -- action you want to do without messages or errors  :system.message_level := old_message_level;end;

If you hold any errors occurring in a variable or in a table you then show your own message after this code by checking your variable if an error has occurred.