Kbase P14381: The Progress ADM2 architecture and table validation messages defined in the Data Dictionary Tool.
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  2/2/2011 |
|
Status: Unverified
SYMPTOM(s):
Trying to erase a record from the database via a Smart Objects Application (toolbar object).
Record being deleted is from a database table that contains a validation expression defined in Data Dictionary to allow record deletions.
Record does not satisfy the database table validation expression.
The Progress ADM2 development model does not display the database table validation message to the 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 hasValMsg in it. The code for the created function should look like as follows:
FUNCTION hasValMsg RETURNS LOGICAL
(pcTable AS CHARACTER) :
DEFINE VARIABLE vlHasValMsg AS LOGICAL NO-UNDO.
{&DB-REQUIRED-START}
IF CAN-FIND(FIRST _file WHERE _file._file-name = pcTable AND _file._valmsg <>
"":U) THEN
ASSIGN vlHasValMsg = TRUE.
{&DB-REQUIRED-END}
RETURN vlHasValMsg.
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('hasValMsg':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.