Field and Form Rules for Request TemplatesThis document guides you through the process of defining rules that can be executed on a Request form. Field and form rules are executed during the following conditions: after a request form is loaded and after a request form is submitted. These rules are not executed at server side, but only at the client side. The rules can be disabled or enabled, wherein the disabled rules will not be applied. Types of Events Supported in Field & Form RulesThe following three types of events are supported: On Form Load: This allows the rules to be executed when the request form is loaded. The rules defined on this event should contain at least one executable action. The actions will be executed after checking criteria; if no criteria is defined, the actions will be executed directly. On Field Change: This allows the rules to be executed, when there is a change in the field value. The rules defined on this event should contain at least one executable action. The actions will be executed after checking criteria; if no criteria is defined, the actions will be executed directly. The rule will be applied on change of the field value mentioned in the rule. On Form Submit: This allows the rules to be executed on submission of the request form. Here, "Execute Script" is the only action allowed for the event. The rules defined on this event should contain a valid script. The script will be executed after checking criteria; if no criteria is defined, the script will be executed directly. Types of UsersThe rules can be applied to Contacts or Support Reps or All users. However, the rules that are applied to Contacts only will not be applied to Support Reps, and vice versa. Execution of RulesThe rules can be executed on creating a new request, or on editing an existing request, or on both of the operations. Types of Actions Supported in Field & Form RulesShow Fields : This action shows the fields in the request form, on which the action is applied. Hide Fields : This action hides the fields in the request form, on which the action is applied. Enable Fields : This action enables the fields in the request form, on which the action is applied. As a result, the user will be able to edit those fields. Disable Fields : This action disables the fields in the request form, on which the action is applied. As a result, the user will not be able to edit those fields. Mandate Fields : This action makes the fields mandatory in the request form, on which the action is applied. As a result, the user will not be able to submit the form without filling values for those fields. Non-Mandate Fields : This action removes the mandatory properties of the fields in the request form, on which the action is applied. As a result, the user will be able to submit form without filling values for those fields. Execute Script : This action executes the script in the request form. The script should be a valid JavaScript code; otherwise it will not be executed. Some methods are supported as default methods in script execution, for example, to hide Category and Level fields you can call the below method with an array of fields as: $CS.hideField(["CATEGORY","LEVEL"]); Copying Rules To Another TemplateYou can copy one or more rules from one template to another, using copy rule action provided in Actions menu. While copying the rule, if a particular field does not exists in the other request template, then that field will not be copied. Also, if for a rule, no criterion/action can be copied, then that rule will not be copied. Removing Fields from Request FormRemoving fields from a template automatically removes those fields from the rules defined in that template as well. After deleting the fields, if for some rule no criterion/action is left out, then that rule will also be deleted. Operations performed on RulesCreating a New Rule
1. Click the Create New Rule button. The Create New Rule form is shown.
2. Fill-in the following details:
Condition Format: Example: v. Actions: Choose an action to be performed while executing the rule. You can add a single action, or multiple actions by clicking the icon. Action Format: Example: Disable Fields
vi. Click Save. The created rule can be viewed from the Rules List View under On Form Load.
1. Click the Create New Rule button. The Create New Rule form is shown.
2. Fill-in the following details:
Condition Format: v. Actions: Choose an action to be performed while executing the rule. You can add a single action, or multiple actions by clicking the icon. Action Format: vi. Click Save. The created rule can be viewed from the Rules List View under On Field Change.
1. Click the Create New Rule button. The Create New Rule form is shown. 2. Fill-in the following details:
Condition Format: <Select Field>
and v. Actions: Only Execute script action is allowed for this event. You need to Write Custom Script. Click the link to View Script. You can view the Sample Script at the right side. Write your Script Code in the left panel and Save it.
vi. Click Save. The created rule can be viewed from the Rules List View under On Submit Form. Editing/Deleting a Rule
Bulk ActionsYou can perform certain bulk actions on the rules. Follow the steps below:
Use Cases for Field & Form RulesA more clear understanding of the field & form rules can be acheived by using real time use cases. Click here to view the document that explains the use cases in detail. |