Consultor Eletrônico



Kbase P82363: VALIDATE method always returns TRUE
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   31/05/2004
Status: Unverified

SYMPTOM(s):

VALIDATE method always returns TRUE

Validating the format of a general FILL-IN variable format

CAUSE:

This is expected behavior. The VALIDATE method only involves the the database trigger (the also called "data-dictionary" validation) or its override in the VALIDATE option of the Format phrase.
If there are no database triggers defined for the field and neither one in the VALIDATE option of the Format phrase, the VALIDATE method always returns TRUE.

FIX:

In order to to trap a bad format date entry you should work at FILL-IN level.
For example in the LEAVE trigger you may have something like:

DO:
DEFINE VARIABLE myDate AS DATE NO-UNDO.

myDate = DATE (SELF:SCREEN-VALUE) NO-ERROR.

IF myDate = ? THEN DO:
MESSAGE 'Date not valid'
VIEW-AS ALERT-BOX INFO BUTTONS OK.
RETURN NO-APPLY.
END.
END.
This allow you to trap the bad entry and handle the situation.