NC4 - E Team - R9.8 E Team Form Builder - Business Rules

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.

User-added image

You may create a new rule by clicking on the User-added image icon. Your new rule is given a randomly generated name. You can edit the name and description as you wish.

Click the User-added image icon to edit an existing rule. You can edit the name, description and statement (JavaScript code) for the rule.

Click the User-added image 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 created as a piece of JavaScript code. Rules are saved when you click Finish while in your designer workspace. Many rules can be validated in preview mode of your form, some rules requiring database lookups require publishing the form to validate.

A rule is of the form:

if (condition)
{
   true actions;
}
else
{
  false actions;
}

Some basic concepts of JavaScript:

  • 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.

Was this article helpful?
0 out of 0 found this helpful

Article Feedback

Please sign in to leave a comment.