Example: orders.4gl (Function order_validate)
This function validates the entries in the fields of the orders
screen record.
Function order_validate (orders.4gl):
1 PRIVATE FUNCTION order_validate(d ui.Dialog) RETURNS BOOLEAN
2
3 IF d.validate("orders.*") < 0 THEN RETURN FALSE END IF
4
5 RETURN order_check(d)
6
7 END FUNCTION
Note:
- Line
01The dialog object is passed to this function, allowing the use of methods of theDIALOGclass. - Lines
3performs a dialog validation process, checking form field constraints such asNOT NULL. If the function fails to validate the user input, we returnFALSE. - Line
5calls theorder_checkfunction to verify order header fields and returns the value returned by this function.