C/AL includes a number of utility functions designed to facilitate data computations and validation or initiation of field contents. The following are some of the Validation Utility Functions:
TESTFIELD function is widely used in standard NAV code. With
TESTFIELD, you can test a variable value and, if necessary, issue an error message in a single statement. The syntax is as follows:
Record.TESTFIELD (Field, [Value] )
Value is specified and the field does not contain that value, an error condition is raised (i.e. the process terminates) and the associated error message is issued. If no
Value is specified, the condition evaluated is relative to zero or blank. If no
Value is specified and the ...