| Parameter | Description |
|---|---|
| iField | Number of the column in the table |
| iErr | Number the error message for column iField should display |
Property String Field_Error
| Write Access: | Set Field_Error iField iErr to StringVariable/Value |
The Field_Error method allows you to define a specific error number and message to be raised whenever validation fails for the column. This means that each column can have its own specific validation error message.
This error is set in the Studio's DataDictionary Modeler by clicking on the Prompt button in the Validation Type row for the desired table column on the Columns tab, and then setting the Valication Error number and text.
The error is triggered when one of the following validation tests fails: Field_CheckBox_Values, Field_Value_Range, Field_Value_Check or Field_Value_Table. Field_Validate_msgs should have their own error texts coded inside the member function.
Set Field_Error Field Customer.Credit_Limit to 200 "Not a legal number"
If you add a custom error number, it will very likely be an unhandled error unless you add it as a handled error by calling (for Windows apps) AddUserError (for web apps: AddUserError).
Note that there is a simpler way to setting a custom error message. Just set the Field_Error to 0 and set the error text. For example:
Set Field_Error Field Department.Budget to 0 "Incorrect budget"See Also