External Data Validation¶
External Data Validation¶
1# This example shows how to validate data input by a user for an external
2# database table. This script should run for the ChangeValidate and InsertValidate
3# database window events.
4
5# The script must display its own error message and can optionally tell
6# the dialog which field to make current after the script finishes.
7
8w = impact.gui.active_database_window
9
10if len(w.values.load("T_TEST")) < 2:
11 impact.gui.show_message(ipShowMessageType.smtError, "T_TEST must be at least 2 characters", None)
12 w.accept_values = False
13 w.current_field = "T_TEST"