Custom Validation Example
Below is an example of a custom validation written to validation dates entered to verify that they are within 90 days from today.
To create a validation, you can use the following steps. It is a good idea to test this in a test database before impacting your live database.
- In UD User Validation Create a new record for the Validation such as Date90Days, Vista will add
uspto the beginning of the name.
- Enter a Description such as Date +- 90 Days from Today.
- In the SQL Tab, enter the validation code from here.
- Save the validation and run the Compile button at the bottom of the form.
- In any Vista form such as AP Transaction Entry entry or AP Unapproved Transaction Entry form, press F3 on the Invoice date field and go to the System Overrides tab. (This validation can be applied to any date field within Vista)
- In the validation section, set the level to your preference such as Warning allow Save if you want to allow saving.
- Select the Custom validation from the lookup on the Procedure field.
- Find the Field Seq# at the top of the form, in the APUnappInv form, field 25 is the InvDate. Enter 25 into the parameters field to link the date entered into the field to the parameter.
- Click OK on the Field Properties form and it will reload the entry form.
- Test your validation to ensure it works as you expect.