Many Built-Ins have the problem, that they don't throw exceptions. (only in the ON-ERROR)
Example: You want to navigate to the block Customer and wrote a typo:
Go_Block ('CUSTOMR');
Do_something_after_Go_Block;
Go_Block can't navigate to the block, because you wrote
CUSTOMR. But no exception is thrown inside the PL/SQL-Block. This means, the code didn't stop and the execution of
Do_something_after_Go_Block starts. This is a big problem in most cases!
Solution: Create a procedure
Check_Builtin
PROCEDURE Check_Builtin IS
BEGIN
IF NOT Form_Success THEN
RAISE Form_Trigger_Failure;
END IF;
END;
Use this procedure after each Built-In:
BEGIN
Go_Block ('CUSTOMR');
Check_Builtin;
Do_something_after_Go_Block;
EXCEPTION
WHEN FORM_TRIGGER_FAILURE THEN
-- do something ...
END;
Also you can create your own Built-In for example
Goto_Block instead of
Go_Block: This new procedure works internally with the new Check_Builtin
PROCEDURE Goto_Block (P_Block IN VARCHAR2) IS
BEGIN
Go_Block (P_Block);
Check_Builtin;
Do_something_after_Go_Block;
END;
and then :
BEGIN
Goto_Block ('CUSTOMR');
Do_something_after_Go_Block;
EXCEPTION
WHEN FORM_TRIGGER_FAILURE THEN
-- do something ...
END;
Important: When you use this technique you have to write an exception-handling and check the
FORM_TRIGGER_FAILURE.
This technique is similiar to Oracle's Check_Package_Failure, but this procedure can only be used, when you work with master-detail-relations.
use Check_Builtin
Gerd