← Return to the list of validators available
If you have a problem understanding how the validator works, check: Validator, Conditional execution, Components parameters
Category: Database
Previous names: Validation of data from the form in the database (up to version 1.0.43)
Available from version: 1.0.14
The validator checks the existence of an entry in the database (eg it can check if there is a user with a given id). Then it checks whether the entry has the same values that are on the form (you can decide for yourself which values to compare).
The validator does not work in preview mode!
The method of operation is presented in the diagram below:
In the add/edit window you can skip validation and continue.
In order for the validator to work correctly we must prepare appropriate queries in the database that will be called when checking the occurence/identity/adding/editing of data. To do this, add four queries to the pm_dbqueries table, remembering to add the appropriate identifier.
Parameter name | From version | Description | Parameter type | Default value | Field type | Comments and restrictions |
---|---|---|---|---|---|---|
Database name * | 1.0.14 | Login of the checked user. | Text |
| List of values |
|
Query key * | 1.0.14 | The parameter determines whether the searched user must be in the list of active users. | Text |
| Editable field |
|
Parameters of query for occurence * | 1.0.14 | The values of the query parameters for occurence | Table of text values |
| Editable field |
|
Parameter types * | 1.0.14 | Types of query parameters for occurence that are stored in the database | Table of text values |
| List of values |
|
Parameters of the identity query * | 1.0.14 | Values of query parameters for identity | Table of text values |
| Editable field |
|
Parameter types * | 1.0.14 | Types of query parameters for identity, which are stored in the database | Table of text values |
| List of values |
|
Parameters of the adding query * | 1.0.14 | The values of query parameters for adding | Table of text values |
| Editable field |
|
Parameter types * | 1.0.14 | Types of query parameters for adding, which are saved in the database | Table of text values |
| List of values |
|
Parameters of the update query * | 1.0.14 | Values of query parameters for update | Table of text values |
| Editable field |
|
Parameter types * | 1.0.14 | Types of update request parameters that are stored in the database | Table of text values |
| List of values |
|
Window name * | 1.0.14 | The title of the window that appears when an identical row is not found | Text |
| Editable field |
|
Question about adding * | 1.0.14 | Message to the user which will appear in the window when no row is found for the given key (option to add a row) | Text |
| Editable field |
|
Question about the update * | 1.0.14 | Message to the user which will appear in the window when a row with a given key is found but with different values (the possibility of updating the line) | Text |
| Editable field |
|
Name of the add button * | 1.0.14 | The name under which the button should appear to add a new row and then accept the task | Text | Add | Editable field |
|
Name of the update button * | 1.0.14 | The name under which the button should appear to update the row and then accept the task | Text | Update | Editable field |
|
Name of the continue button * | 1.0.14 | The name under which the button should appear to continue without modifying entries in the database | Text | Continue | Editable field |
|
Name of the undo button * | 1.0.14 | The name under which the button should appear to return to the task form | Text | Return to form | Editable field |
|
Example: Assume you want to check if there is a user whose data is stored on the form. The example entries in pm_dbqueries might look like this:
name | query |
---|---|
USERS_EXIST | SELECT * FROM pm_cust_users WHERE username = ? |
USERS_EQUAL | SELECT * FROM pm_cust_users WHERE username = ? AND firstname = ? AND lastname = ? AND address = ? |
USERS_INSERT | INSERT INTO pm_cust_users (username, firstname, lastname, address) VALUES (?, ?, ?, ?) |
USERS_UPDATE | UPDATE pm_cust_users SET firstname = ? , lastname = ?, address = ? WHERE username = ? |
In this example, our query key is USERS. We need to add the following to the question key: _EXIST, _EQUALS, _INSERT or _UPDATE to determine their purpose. Parameters marked with a question mark can be added in the configuration of the validator (remember the order! In the last query the row identifier appears at the end!)
Configuration for this example might look like this:
1.0.14
Adding a component
1.0.36
Change of section from "General" to "Database"
1.0.43
Changing the name from "Validating data from the form in the database" to "Verifying data from the form in the database"
1.0.57
Adding a dynamic form
The license could not be verified: License Certificate has expired!
Add Comment