You are here: Reference > Rule types > Constraints > Constraints form - Completing the Constraints tab

Constraints form
Completing the Constraints tab

  1. About 
  2. New 
  3. Constraints 
  4. Pages & Classes 
  5. History 
  6. More... 

Record the computations that constrain the property values. Each row defines a separate constraint. Enter at least one row. Order is not significant.

When the system detects that a constraint fails, it adds a message to the page of the property identified in the left portion of the Require That field (if any). The presence of this message ordinarily prevents the system from saving the page containing this property value to the database.

You can cause a specific additional message (Rule-Message rule type) to become associated with that property or another property when the constraint fails, in the Else row.

Detection of this message and any later processing to correct the constraint — such as displaying a message to a user, recalculation of the property value, and so on — is an application responsibility.

Each property involved in the constraint expression must be on the primary page (the page that has the class corresponding to the Applies To key part), or on an embedded page identified in Page Context field on the Pages & Classes tab, or on a linked property page.

Using the controls

Click any constraint to enable controls.

Control

Action

open icon
magnifying glass

Click to review a property (for a field that contains a property reference). If the property does not exist, click themagnifying glassbutton to create a new property.

expression selector

Click the button to display a drop-down list of all boolean expressions.

row buttons
,, and

Select any constraint to enable. Click the ,, or buttons to add a new constraint before or after the selected constraint, or to delete the selected constraint. (Equivalently, use the  Insert  ,  Shift+Insert  , and  Delete   keys.)

Display Name

Display Label

When reviewing this tab, you can see a presentation using either property names or the Short Description (pyLabel) of properties. Click to toggle the display. (Note that two or more properties may have the same Short Description text.)

Modifying constraints with drag and drop operations

To move a constraint to a different location, click and drag the small circle located to the left of the entry.

To copy a constraint, drag the entry while holding down the CTRL key.

Completing fields

Field

Description

When

Click the button to select a boolean expression from the drop-down list. The form changes to reflect the expression selected.

Most expressions require properties. Use SmartPrompt to select a property. You can enter a linked property reference here.

Require that

This area defines the constraint. Click the button to select an expression from the drop-down list. The form changes to reflect the expression selected.

Most expressions require properties. Use SmartPrompt to select a property, or enter a linked property reference.

You can't specify single elements of a Value List, Value Group, Page List or Page Group in property references here. Use only empty parentheses containing no index or subscript, for example:

pyWorkPage.pyWorkParty().pxCity = "Chicago"

Else add message

Optional. Type the text of a message within quotes or use the SmartPrompt to select the name of a Rule-Message. The list of options is limited to Error and blank category messages. Commonly used messages include:

  • ValueRequired — Value cannot be null (blank)
  • ValueOutOfRange — Value is out of range

Some messages require parameters. To provide fill-in-the-blank text values for each parameter, follow the message name with a backslash character, the single letter t, and text for each message parameter.

to

Optional. Identify the property to be marked with the message. The message remains until this property has a new value (or until an activity performs a Page-Clear-Messages method).

Ordinarily, choose the property that failed the constraint. Some constraints involve two or more properties, on the same or different pages. Select the one most likely to have a new value that will restore the constraint condition.

For example, if the constraint is of the form

BoxWidth IS LESS THAN 40

then the message can be associated with the BoxWidth property. If the constraint has the form

BoxWidth IS LESS THAN BoxLength

then the message can be associated with either property.

In unusual cases, you can leave this blank. When you leave this blank, the message is associated with the entire page rather than a property on that page. However, this is temporary, as page messages are removed upon the next user HTTP Submit operation.

You can't use symbolic page names (such as primary or steppage) here, as they are not meaningful except within an activity execution context.

Up About Constraints rules