Create Field Validation Formulas

Input validation formulas provide a means to ensure that users enter correct and complete data by preventing users from saving a document if a field's value is invalid. Every time a document is saved or refreshed, the input validation formulas are executed to ensure that the proper values have been entered. For each field, the value is tested according to the formula, and if the value is acceptable, the formula returns true and the document can be saved. If a value is unacceptable, the formula returns false and the document cannot be saved until the proper data is entered. Additionally, the user is prompted with a message supplied by the developer to explain the problem.

When creating input validation formulas, you must use the @Failure and @Success functions. @Success returns true and allows the document to be saved. @Failure returns false and displays a prompt with a message the developer supplies as a parameter. Additionally, it causes the termination of the save.

To create an input validation formula, follow these steps:

1.
Open the form in the Designer.

2.
Select or create the field for which you want to add an input validation formula.

3.
Select Input Validation on the Objects tab.

4.
Enter a formula in the Programmer's pane.

5.
Save the form.

The following example demonstrates an input validation formula that tests the tLastname field to ensure that it is not empty. If tLastname is empty, a prompt displays the message Please enter a value for last name. and the save is aborted.

@if(@Trim(tLastName)="";@Failure("Enter a value for last name.");@Success);

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.215.0