uniface.ValidationError
The uniface.ValidationError object provides access to the error number and message of a validation error on the server. It is returned by the FieldErrorContext.getError function when used in the showError and clearError web triggers.
Syntax Error Properties
Property Name | Description |
---|---|
message | Validation error message. |
valueInError | Field value that caused the validation error. |
Description
A uniface.ValidationError object is generated when validation fails on the server after data has been submitted from the client.
You can access the properties of the uniface.ValidationError using the getError function of the field. For more information, see getError().
Using uniface.ValidationError
For example, in the following code, the showError web trigger is used to display an alert box with the information about the error.
webtrigger showError javascript // this = the current FieldErrorContext object var vErrorObject = this.getError(); var vErrorString = "There is a Validation Error.\n\n"; vErrorString += "Value in error: " + vErrorObject.valueInError+ "\n\n"; alert(vErrorString); // Show error alert box endjavascript return true end