Function order_validate
This function validates the entries in the fields of the orders
screen record.
Function order_validate
(orders.4gl):
01
FUNCTION
order_validate(d)
02
DEFINE
d ui.Dialog
03
IF NOT
d.getFieldTouched("orders.*") THEN
04
RETURN TRUE
05
END IF
06
IF
d.validate("orders.*") < 0 THEN
07
RETURN FALSE
08
END IF
09
IF NOT
order_check_store_num() THEN
10
RETURN FALSE
11
END IF
12
RETURN TRUE
13
END FUNCTION
Note:
- Line
01
The dialog object is passed to this function, allowing the use of methods of theDIALOG
class. - Lines
03
thru05
returnTRUE
to the calling function if the fields in the orders record have not been touched. - Lines
06
thru08
call thevalidate()
method of the dialog object to execute anyNOT NULL
,REQUIRED
, andINCLUDE
validation rules defined in the form specification file for the fields in theorders
screen record. If this validation fails,FALSE
is returned to the calling function. - Lines
09
thru11
call theorder_check_store_num
function to verify that thestore_num
value exists in thecustomer
database table. If this validation fails,FALSE
is returned to the calling function. - Line
12
returnsTRUE
to the calling function when the validation is successful.