Specifying Constraints and Indexes

The Unique flag on a form or type is an example of a constraint: it stops the user from creating or modifying duplicate records that have the same value for those fields combined. That's a basic example of a constraint, but WorkflowFirst supports other, more advanced constraints that can be specified in the Constraints drilldown (Hamburger icon) for a form or type.

You can add multiple constraints. Click Create New ( + )to add a new constraint.

First, you need to enter a Group Name for your constraint. It doesn't matter too much what this name is as long as it roughly describes what the constraint means.

Next, you can specify the type of constraint. Currently there are three: Indexed, Unique Index, and Deep Query Index

Indexed constraint simply optimizes how records are found in the database. A bit like an index in the back of a book. It allows WorkflowFirst to quickly locate a record for a given value rather than having to search through the whole database one record at a time. 

Unique Index constraint is similar to Indexed. It also optimizes how records are found but in addition to that, the combination of field values must be unique in that list. For example, the Last Name and First Name must be unique as a combination, rather than individually, then you would create a Unique Index and select the First Name and Last Name fields in the field selections that are provided.

Important Note: If you add a Unique Index to a type that has existing data, then any duplicate values pertaining to that index will be automatically DELETED by the system at startup. It is important to backup data before adding unique indexes if there is a risk of data loss.

Deep Query Index is an advanced option that can be used when you have scripts that perform deep queries (ie. load with deep) with filters applied. Deep queries do not use regular indexes, so any predicates (filters) used must be indexed separately using this Deep Query Index option.

Note : Only up to three field selections for an index are currently supported. 


Next Topic:
v4.2.0.956 (beta)
Up Since 2/29/2024 12:02:23 AM