Consultor Eletrônico



Kbase P144491: Expected error message is not displayed in a message box
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   22/09/2009
Status: Unverified

SYMPTOM(s):

Expected error message is not displayed in a message box

Program originally developed in version 8

Cannot delete records in the application

Problem is found by all end-users

FACT(s) (Environment):

Records are deleted using ADM procedure
RUN dispatch IN THIS-PROCEDURE ('delete-record':U).
In case of an error when the record is deleted ADM show-errors procedure is executed
ADM show-errors procedure executes local-show-errors to display RETURN-VALUE attribute of call object handle
The following code is executed in local-show-errors:

IF ERROR-STATUS:ERROR THEN
DO:
MESSAGE RETURN-VALUE.
END.
Windows
OpenEdge 10.1C

CHANGE:

Program migrated from version 8 to 10

CAUSE:

RETURN-VALUE provides a character string value returned by the most recently executed RETURN statement of a local or remote procedure , trigger block, user-defined function, method of a class, class constructor, or property accessor. It does not return the error message.
Programmer expected RETURN-VALUE of the delete-record procedure, but since show-errors executes other statements after deleting the record RETURN-VALUE contains the return value of the last procedure executed. RETURN-VALUE received was blank.

FIX:

Change code in user program to return a user message, so the ADM local procedure (local-show-errors) will display it:
RUN <user_program> NO-ERROR.
IF ERROR-STATUS:ERROR THEN DO:
RETURN ERROR "<USER_MESSAGE>".
END.