Kbase P16122: Database trigger validation messages and the Progress ADM2 architecture.
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  02/02/2011 |
|
Status: Unverified
SYMPTOM(s):
Trying to erase a record from the database via a Smart Objects Application (toolbar object) running on an AppServer.
Record being deleted is from a database table that contains a delete trigger defined in Data Dictionary.
Record does not satisfy the database delete trigger validation expression for this particular database table.
The Progress ADM2 development model does not display the database delete trigger validation message to the end-user.
FACT(s) (Environment):
Progress 9.x
CAUSE:
Bug# 20021120-027
FIX:
Follow the steps below to workaround this issue:
1- Make a local copy of the $DLC/src/adm2/custom/datacustom.i ADM2 program and create a function named hasDelTrg in it. The code for the created function should look like as follows:
FUNCTION hasDelTrg RETURNS LOGICAL
(pcTable AS CHARACTER) :
DEFINE VARIABLE vlHasDelTrgMsg AS LOGICAL NO-UNDO.
{&DB-REQUIRED-START}
FIND FIRST _file NO-LOCK
WHERE _file._file-name = pcTable NO-ERROR.
IF AVAILABLE _file THEN
ASSIGN vlHasDelTrgMsg = CAN-FIND(FIRST _file-trig WHERE _file-trig._file-recid = RECID(_file) AND _file-trig._event = "DELETE":U).
{&DB-REQUIRED-END}
RETURN vlHasDelTrgMsg.
END FUNCTION.
2- Make a local copy of the $DLC/src/adm2/custom/smartcustom.i ADM2 program and uncomment the RUN statement that starts the smartcustom.p super procedure in the main-block.
3- Make a local copy of the $DLC/src/adm2/custom/smartcustom.p ADM2 program and create an internal procedure named addMessage in it. The code for the created procedure should look like as follows:
PROCEDURE addMessage :
DEFINE INPUT PARAMETER pcText AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER pcField AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER pcTable AS CHARACTER NO-UNDO.
IF pcText MATCHES "*delete*":U AND
pcTable <> "":U AND
DYNAMIC-FUNCTION('hasDelTrg':U IN TARGET-PROCEDURE, INPUT pcTable) THEN
pcText = pcText + "~n":U + ERROR-STATUS:GET-MESSAGE(1).
RUN SUPER(pcText,pcField,pcTable).
END PROCEDURE.
4- Recompile the Smart Objects involved in the Application.
FIX:
Upgrade to the latest 9.1D Service Pack.