Display Datasource Error Messages

By default, if a problem occurs when downloading data from a remote datasource or updating a database with input data from the form, no error message will be displayed at runtime. This topic explains how you can provide error messages to be displayed in these situations.

 

Two default user-configurable error messages are available which will be used where you don't specify a specific message. One is specified at the form level and is used for data download and update actions initiated within Events and the other is used by the Submit Button. The default form-level message is also used for all data downloaded when the form loads.

Alternatively, you can specify your own error messages using custom JavaScript and assign them to individual data download, data update or submit actions.

In either case, you will need to enable the display of data error messages before the error messages will be displayed. This is done by selecting the Display Error Messages property within the form properties. If this property is not selected, the error messages will not be displayed.

The text of the default form-level error message can also be edited under the form properties, using the Default Error Message property. Edit this property to enter your chosen text for these default error messages.

The text for the Submit Button's default error message is specified under the properties for the button itself, using its Error Message Text property under the properties' Advanced tab.

 

If an error occurs at runtime and data error messages are enabled, your error message will be displayed in a pop-up message box, which the user will need to acknowledge in order to dismiss it and return to the form. If you have Client logging enabled, the error message pop-up will also display the HTTP error code(s) and message(s) returned to the form as a result of the error(s).

When you select the Display Error Messages property for the first time within a form, Form Studio will add a style called Datasource_Error_HeaderStyle to the Styles gallery. This style is used to format the header of the error message pop-up and can be modified in the same way as any other style, if you want to change the appearance of the error message.

 

 


See also:

Customise Forms with JavaScript

Edit Custom JavaScript

Events

Diagnostics, Audit Logging and Analytics