The override rule is useful in restoring default values or forcing calculated values into a control. This can greatly enhance the specification experience by simplifying choices or entries the user has to make. Some form controls have the ability to force a value into the control that will override any entry or selection made by the user. The chart below lists the controls that have this dynamic property available:
Control Type | Override Rule property name |
---|---|
Check Box | Checked (Override Rule) |
Combo Box | Selected Item (Override Rule) |
List Box | Selected Item (Override Rule) |
Option Group | Selected Item (Override Rule) |
Spin Button | Value (Override Rule) |
Text Box | Text (Override Rule) |
When forcing a value into the control using the Override Rule property it is important to understand that the result of the Override rule takes priority over what is actually displayed in the control.
For example a check box has it's override rule to be:
IF ( MyOptionsReturn = "Type A" , TRUE , MyCheckBox )
Where MyOptionsReturn is a combo box from which "Type A" can be selected
True is the result forced into the check box control when "Type A" is selected
MyCheckBox is the name of the check box the override rule is being applied to.
The rule above will force the value of the check box to equal True (checked) when the selection in the control MyOptions equals Type A.
The check box can be de-selected (unchecked) while the value in the control MyOptions equals Type A, but the value DriveWorks will always use is the result of the override rule. To prevent the control from displaying information that is contradictory to the result of the override rule please refer to the Considerations when using the Override Rule section below.
Override rule must result in True or False. It must also conform to any form messages that could be displayed by the Error Result property.
Override rule must result in an item that can be selected from the combo box. It must also conform to any form messages that could be displayed by the Error Result property.
Override rule must result in an item that can be selected from the list box. It must also conform to any form messages that could be displayed by the Error Result property.
Override rule must result in an item that can be selected from the option group. It must also conform to any form messages that could be displayed by the Error Result property.
Override rule must result in a number that falls in between the minimum and maximum property values set for the control. It must also conform to any form messages that could be displayed by the Error Result property.
Override rule must result in text or a number that conforms to any form messages that could be displayed by the Error Result property.
To select just the control name and not its Return value, from the Rule Builder:
It is highly recommended that when using the override rule the Enabled property is set to False (disable). This will force the user into entering different information into the control that has invoked the override value.
For example a check box has it's override rule to be:
IF ( MyOptionsReturn = "Type A" , TRUE , MyCheckBox )
It should also have the following rule for the Enabled property:
IF ( MyOptionsReturn = "Type A" , FALSE , TRUE )
Now when the control MyOptions equals "Type A" the check box will be checked (TRUE), but it will also be disabled (FALSE), preventing the user from un-checking the check box.