Rules add behavior to forms. For instance, you can add a rule that will show/hide certain form controls or entire sections based on the state of other form controls. Displaying form fields in a context-sensitive manner reduces clutter and makes it easier for users to navigate your forms. Rules can also be used to update form values. For instance, you can compute the total damages from values of other form fields such as item quantity and cost.
Working with Rules
In the form designer, click on the Rules tab. The page will display any existing rules that may have created for the form. When E Team Custom Controls have been added you will see a section labeled Custom Controls. Rules in this section for E Team Custom Controls will be locked and cannot be altered.
You may create a new rule by clicking on the icon. Your new rule is given a randomly generated name. You can edit the name and description as you wish.
Click the icon to delete a rule. Confirm your choice in the dialog that pops up and the rule will be immediately removed. This is an irreversible process so make sure you do not need the rule before you delete it.
Rules can be temporarily disabled by unchecking the Enabled checkbox.
Writing Rules / Syntax
A rule is of the form:
- Everything is case-sensitive. Ex: var color1 and var Color1 are two different variables.
- Variables are loosely typed. Ex: var color = 'red'; and var num = 33 cause the variable color to be a string type and num to be a numeric type.
- End-of-line semicolons are optional. However we recommend you use semicolons to terminate lines as part of proper coding practice as this often prevents mistakes. Also the rules validator will flag missing semicolons as an issue. So do add them to your lines.
- Comments. Code can be commented out using either // or /* */ syntax.
E Team uses a fully integrated version of frevvo forms. To get additional help on business rules you can review and download frevvo Business Rules documentation.
You can find examples of commonly used rules for E Team custom forms in our FAQ's.