Saturday, July 18, 2009

TESTFIELD & VALIDATE Functions

TESTFIELD Function
TESTFIELD tests whether a field contains a specific value. It has the following syntax.
Record.TESTFIELD(Field, [Value])
If the test fails, that is, if the field does not contain the specified value, an error message is displayed and a runtime error is triggered. This means that any changes that were made to the record are discarded. If the value that you test against is an empty string, the field must have a value other than blank or 0 (zero).
One of the main feature of this function is that, if you want to check any field where value is their or not, You can Use this function, So that without giving any data to that particular field, System won't allow the user to Post the document. For this you can simply write
TestField(Fieldname);
VALIDATE Function
VALIDATE calls the OnValidate trigger of a field. It has the following syntax.
Record.VALIDATE(Field [, NewValue])

No comments: