Appearance
setValidationError(columnName, errorMessage)
Applies an error state to a specific column with an error message.
Scope: FORM
Parameters
| Parameter | Type | Description |
|---|---|---|
| columnName | string | The name of the database table column. |
| errorMessage | string | The error message shown to the user. |
Return Value
None
✨ Example of a preFormSubmit Hook
Prevent update customer with ID 103.
js
((mode, getColumnValue, setValidationError, unsetValidationError) => {
const error = "Customer 103 cannot be updated!"
const customerNumber = getColumnValue("customerNumber")
if (customerNumber == 103) {
// Set validation error
setValidationError("customerNumber", error)
} else {
// Don't forget to reset!
unsetValidationError("customerNumber")
}
})Output

