Customizing the error message

When you define a validation rule, PocketBuilder automatically creates the error message that displays by default when users enter an invalid value:

'Item ~'' + @Col + '~' does not pass validation test.'

You can edit the string expression to create a custom error message.

Different syntax in the DataWindow painter

If you are working in the DataWindow painter, you can enter a string expression for the message, but you do not use the @ sign for placeholders. For example, this is the default message:

'Item ~'' + ColumnName + '~' does not pass validation test.'

A validation rule for the Salary column in the Employee table might have the following custom error message associated with it:

'Please enter a salary greater than $10,000.'

If users enter a salary less than or equal to $10,000, the custom error message displays:

Figure 21-10: Custom message triggered by validation rule violation

Shown is a custom error message triggered by a validation rule violation. The message prompts the user to enter a salary greater than ten thousand dollars.