Custom Validation

The Custom Validation form allows you to define customized Event and Prompt validations.

Once you create a custom validation, it is available on the Validation tab of the Events form in the Custom Validation ID field.

If you are defining a custom validation for an Event Validation, the validation must be a Query.

If you are defining a custom validation for a Prompt Validation, the validation can be any of the Validation Types (Static, List, Query, Rule, or Ruleset).

See Also:

Custom Validation Field Descriptions

Find, Add, Modify, Delete, or Copy a Custom Validation

Using Semantics in the Custom Validation Query

Using Prepared Statements in Queries

 

Custom Validation Field Descriptions

Custom Validation ID

System-generated identification number for the record.

Validation Type

Static: A non-changing, constant value. For example, YES.

List: A list of comma separated values against which the event or prompt will be validated.

Query: The validation will be performed against a request for information presented to the database. For example: select distinct charge_element.data_group_name FROM charge_element where charge_element.charge_type = "ORDER". You can include prepared statements in these queries. You can also use semantics and event prompt values in this query; see Using Semantics in the Custom Validation Query.

Rule: The event or prompt will be validated against a rule with the PVEValidationRuleset context.

Ruleset: The event or prompt will be validated against a ruleset with the PVEValidationRuleset context.

Description

A description of the custom validation. The Description will be shown in the Custom Validation ID field in the Validation tab of the Events form.

Value

If the Validation Type is Static, List, or Query, the Value field identifies the actual validation value (static value, list, query, etc.).

If the Validation Type is Rule or Ruleset, the available options will be rules or rulesets with the PVEValidationRuleset context.

Number of Parameters

Number of parameters in the query.

Update Date, Updated By

These fields display when the record was created or updated, and the person who created or updated the record.

 

Find, Add, Modify, Delete, or Copy a Custom Validation

To find a custom validation, click the Filter button at the top of the form and use the Validation Type, Description, and Value fields to search for specific records. Click Find to display the search results.

To add a new custom validation, click Add. Enter values in the fields and click Save.

You can modify any setting in the custom validation except the Validation Type.

You can copy a custom validation and save the duplicate with a new name. To do so, select the custom validation and click Copy. Change the fields as necessary and click Save.

You cannot delete a custom validation if it has been assigned to an event or prompt.

 

Using Semantics in the Custom Validation Query

You can use the following semantics in a Custom Validation Query to specify the person for whom the event is posting, the name of the event, and other values:

[%GID%]

[%DID%]

[%PERSON_ID%]

[%PERSON_NUM%]

[%CREATOR_ID%]

[%EVENT_NAME%]

[%TIMESTAMP%]

[%ROUNDED_TIMESTAMP%]

[%POST_DATE%]

[%TIMEZONE%]

You can also use the event's prompts (defined on the Prompt tab) in the query. For example, if the event has a Project number prompt (F_PROJECT), you can use [%F_PROJECT%] in the query to specify the Project number the user entered. You can use the F_HOURS and F_POSTING_DATE prompts, even if they are not included in the event's prompt configuration.