Creating a conditional action expression - simple example

This sample scenario shows how you can use Windows client to generate conditional action expressions. Conditional action expressions have three parts: the action, the condition, and the value.

In this scenario, you want to make the Credit Hold Date a required field when users select the Credit Hold check box.

  1. Open the form whose collection includes the CreditHoldEdit component and the CreditHoldDateEdit component.
  2. Go into Design Mode and select the field (CreditHoldDateEdit component) for which you want to set the conditional requirement.
  3. In the Component property sheet for CreditHoldDateEdit, select the Required When property and click the ellipsis (...) button that displays.

    This automatically sets Action Type to Required and Action Value to #C(CreditHoldDateEdit).

    This is the "Action" part of the expression: "The Credit Hold Date component is required..."

  4. In the Edit Condition dialog box:
    • Click Edit Left Value. Set Value Type to ComponentValue and Value to CreditHoldGridCol.
    • Set Operator to =.
    • Click Edit Right Value and set Value Type to Literal and Value to 1.

      A value of 1 indicates that the component check box is selected.

    This translates to #C(CreditHoldGridCol) = "1"

    This is the "Condition" part of the expression: "...when the Credit Hold component is selected."

  5. Click OK and see the full expression in the Edit Set of Conditional Actions dialog box:

    Required:#C(CreditHoldDateEdit), #C(CreditHoldGridCol) = "1", "True"

    The "Value" part of the expression is automatically generated in this case and is set to True to indicate that the component's value is required if the condition is true.

  6. To return to the Component property sheet and store the conditional expression in the Required When property of the CreditHoldDateEdit component, click OK.
  7. Save the form and test it to make sure that selecting Credit Hold makes Credit Hold Date a required field.