Kbase P87091: How to display a non error type message from client-side validation ?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  16/10/2008 |
|
Status: Unverified
GOAL:
How to display a non error type message from client-side validation ?
GOAL:
How to display a question message in the client-side validation and eventually cancel the record update ?
FACT(s) (Environment):
Dynamics 2.1A
FIX:
Progress recommends to add client-side validation code inside the RowObjectValidate procedure.
However, at this time from inside RowObjectValidate you can display only error messages.
If the update source is an SDV or a dynamic viewer, a solution would be to to add the validation code inside the UpdateRecord procedure defined in the SDV or in the dynSDV custom super procedure.
Example:
PROCEDURE UpdateRecord:
/*------------------------------------------------------------------------------
Purpose:
Parameters:
Notes:
------------------------------------------------------------------------------*/
DEFINE VARIABLE cDummyButton AS CHARACTER NO-UNDO.
DEFINE VARIABLE cButtonPressed AS CHARACTER NO-UNDO.
DEFINE VARIABLE cAnswer AS CHARACTER NO-UNDO.
DEFINE VARIABLE plAnswer AS LOGICAL NO-UNDO.
RUN askQuestion IN gshSessionManager (
INPUT 'UpdateRecord: continue ? ', /* pcMessageList */
INPUT "Yes,No", /* pcButtonList */
INPUT "YES", /* pcDefaultButton */
INPUT "NO", /* pcCancelButton */
INPUT "Record Update", /* pcMessageTitle */
INPUT "", /* pcDataType */
INPUT "", /* pcFormat */
INPUT-OUTPUT cAnswer, /* pcAnswer */
OUTPUT cButtonPressed /* pcButtonPressed */
) NO-ERROR.
CASE cButtonPressed:
WHEN "YES" THEN plAnswer = TRUE.
WHEN "NO" THEN plAnswer = FALSE.
END CASE.
IF NOT plAnswer THEN RETURN 'ADM-ERROR'.
RUN SUPER.
RUN showMessages IN gshSessionManager (INPUT "Record updated",
INPUT "inf",
INPUT "&OK",
INPUT "&OK",
INPUT "&OK",
INPUT "INFORMATION",
INPUT NO,
INPUT ?,
OUTPUT cDummyButton).
END PROCEDURE.