How to prevent duplicate error messages in Forms.
539222Oct 2 2007 — edited Dec 2 2011Hello,
When I have a problem on a datablock, I usually do a "Raise Form trigger Failure" to stop the trigger and display a message. But if the datablock has a relationship to another block, the system will try to do the ON-POPULATE-DETAILS and the QUERY-MASTER-DETAILS to complete the relationship process. In the QUERY-MASTER-DETAILS, there are statements listing the following
IF reldef = 'FALSE' THEN
GO_BLOCK(DETAIL);
Check_Package_Failure;
:System.Message_Level := 10;
Execute_Query;
:System.Message_Level := oldmsg;
ELSE
The problem occurs in the GO_BLOCK(DETAIL). An error message has already shown before the system reaches this line. When the GO_BLOCK(DETAIL) occurs, the system will jump to the block connected in the relationship. I have a WHEN-VALIDATE-RECORD on the original block. Doing the GO-BLOCK will cause the WHEN-VALIDATE-RECORDS to process again. This causes the original error message to appear again. The user sees the message appearing twice on their screen. Once the GO-BLOCK process has completed, the CHECK_PACKAGE_FAILURE starts and the system completes the process.
My question is how can I handle this situation so that the second message does not appear because of the GO_BLOCK process? I don't want to break the relationship process. I just want a clean way to deal with the second message because of the second validation.
Thanks.