OSTENDO
Reference Guide

User Defined Validations


File: > Customisation Configuration -> User Defined Validations

The idea of this feature is to allow you to defined default field validation rules. This can be useful when setting up new records be they Customers, Supplier, Items etc..  These User Defined Validations are run both or either (depending upon the setting selected) when a new record is either 'Inserted' into the database or when an existing record is Updated.

This feature can be used to check for no entry of a field value or check to see if the field value meets a specific condition or value. Unlike Required Fields which only check for a field value, this feature provides far more detailed conditioning. This avoids the need for defining Required Fields, Custom Triggers and Screen Data Scripts in order to force field validation of a blank field value.

An example of this is if you creating or updating an item and if the item Category was either 'Accessories' or 'Fasteners' then the Analysis Group for that item must not be left blank.

eg: CustomerMaster.SalesPerson (aliases may be used to abbreviate table names 'OTHER'  than Primary Table Name)

eg:

Select ITEMMASTER.ANALYSISGROUP fromITEMMASTERwhereITEMMASTER.ITEMCATEGORY IN ('Accessories','Fasteners')

eg: (coalesce(CUSTOMERMASTER.CUSTOMEREMAIL, '')  = '')(The coalesce guards against the possibility of a 'blank' existing in the email field)

Suppose we want to force the user to enter aPrimary Supplierwhen they create a new Item that has a Category of'Fasteners'

Table Name

Field Name

Validation Style

Validation Message

From Clause

Conditional Clause

Rule Status

Restricted User

ITEMMASTER

PRIMARYSUPPLIER

Raise Error if Condition is met on Insert Only

A Supplier must be specified for Items Categorised as Fasteners

ITEMMASTER

(coalesce(ITEMMASTER.PRIMARYSUPPLIER, '')  = '') AND ITEMMASTER.ITEMCATEGORY = 'Fasteners'

Active For All Users


Suppose we want to force the user to enter an an Email Addressif  the Email Address field is left blank when creating a new customer

Table Name

Field Name

Validation Style

Validation Message

From Clause

Conditional Clause

Rule Status

Restricted User

CUSTOMERMASTER

CUSTOMEREMAIL

Raise Error if Condition is met on Insert Only

Email Address must be entered

CUSTOMERMASTER

(coalesce(CUSTOMERMASTER.CUSTOMEREMAIL, '')  = '')

Active For All Users


Suppose we want to force the user to enter an an Email Addressif  the Email Address field is left blank when creating or updating a customer

Table Name

Field Name

Validation Style

Validation Message

From Clause

Conditional Clause

Rule Status

Restricted User

CUSTOMERMASTER

CUSTOMEREMAIL

Raise Error if Condition is met on Insert or Update

Email Address must be entered

CUSTOMERMASTER

(coalesce(CUSTOMERMASTER.CUSTOMEREMAIL, '')  <> '')

Active For All Users


Suppose we want to force the user to enter aPrimary Supplierwhen creating or updating an existing item that has a Category of'Fasteners'

Table Name

Field Name

Validation Style

Validation Message

From Clause

Conditional Clause

Rule Status

Restricted User

ITEMMASTER

PRIMARYSUPPLIER

Raise Error if Condition is met on Insert or Update

A Supplier must be specified for Items Categorised as Fasteners

ITEMMASTER

(coalesce(ITEMMASTER.PRIMARYSUPPLIER, '')  = '') AND ITEMMASTER.ITEMCATEGORY = 'Fasteners'

Active For All Users