Add or Edit a Field Condition

Conditions can be created for fields that must be met before a work activity can be canceled, closed, or updated. For example, a condition can be created to ensure that an asset is attached to a work order before it is closed. If the condition is not met, administrators can configure a message to display that lets the user know what information needs to be populated. On service requests and work orders, custom fields can be used to create conditions.

  1. Select a Template that has an existing Field Validation Event.

  1. Select the event you'd like to add a condition to.
  2. Click Add record under the Field Conditions section.

  1. Enter the Name of the condition.
  2. Select the Validation Type: Information, Warning, or Error.
  3. Enter the Validation Message to User that displays when the condition is not met.

  1. Click Empty query and click Add Condition.
  2. Select fields from the drop-down lists to construct a condition. For example, if this condition was selected from the drop-down lists, LaborCost > 0, an error would display if no labor was added to the work activity.

NOTE: Many of the fields found on work activities can be found under Fields > Current Value ($) and Fields > Previous Value($$). The previous value is the value upon opening a work activity and the current value is what the field value was changed to after the work activity was opened.

  1. Click Add.

The condition appears under the Fields Conditions section.

  1. To edit a field condition, expand the details and make any desired changes.
  2. Click Save.

Here is an example of what it looks like when a user tries to close a work order that has field validations set up:

IMPORTANT: Test the conditions on the template after creating them to make sure they are working as intended, particularly when using NULL.

EXAMPLE

Create a field condition that checks if a field is populated: $.<FieldName> != NULL. NULL can only be used on numeric or date fields.

  1. From the Fields > Current Value ($) list, select the field you need populated.
  2. From the Select Operator drop-down list, select the not equal sign ().
  3. Select NULL from the Change operator drop-down list.

EXAMPLE

Create a field condition that checks if a field is populated where NULL does not work, like string fields: StringLength($.<FieldName>) > 0. If the field is blank in the database, "!= NULL" does not work. Instead, you need to check that the field length is greater than 0.

  1. From the Functions list, select StringLength().
  2. In the StringLength parenthesis, select Resolution from Fields > Current Value ($).
  3. From the Select Operator drop-down list, select the greater than sign (>).
  4. In the Change operator drop-down list, select Integer and enter 0.