Kbase P18374: How to validate one cell in a browse against another field
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  3/12/2003 |
|
Status: Unverified
GOAL:
How to validate one cell in a browse against another field
FIX:
In order to do this you should use the CAN-FIND statement inside the VALIDATE.
Here is a sample working against the sports2000 database.
DEFINE QUERY myQuery FOR customer.
DEFINE BROWSE myBrowse QUERY myQuery SHARE-LOCK DISPLAY state name
ENABLE customer.state VALIDATE
( CAN-FIND (state WHERE state.state = customer.state) ,
"VALIDATE MESSAGE: Incorrect Country")
AUTO-RETURN
WITH no-box 10 down
separators
SIZE 50 by 6.5.
OPEN QUERY myQuery FOR EACH customer.
ENABLE myBrowse WITH FRAME fr.
WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW.