UI policy options

You can use different options in the UI Policy form to control when and how the UI policy is applied. These options include client scripts, OnLoad execution, and view-specific UI policies.

Client scripts for UI policies

Administrators can use the UI Policy form to create client scripts that run onChange when the UI policy conditions are met (Execute if true) or not met (Execute if false).To display these scripting fields in the UI Policy form, in the Script section, select the Run scripts check box.

For example, to display an alert to the user when the incident State field changes to Resolved, create the following script in the Execute if true field.
function onCondition(){
alert('You changed the "Incident state" to Resolved. Please enter your comments in the "Close notes" field.');
}

On load check box

You can check or clear the On load check box in a UI policy to control whether it runs every time a form is loaded when the conditions are satisfied. In this example, an administrator does not want an incident to enter the Awaiting user info state unless the user provides an explanation to the customer. The administrator creates a UI policy with the following settings.
  • In the When to Apply section, adds the condition [State] [is] [Awaiting user info] and clears the On load check box. This condition means that the UI policy applies only when the state is changed to Awaiting user info.
  • In the UI Policy Actions related list, creates a record that makes the Additional comments field mandatory when the condition is met.

If the administrator selected the On load check box, the UI policy would apply every time a user opens an incident in the Awaiting user info state.

View-specific UI policies

By default, the Global UI policy applies to all form views. However, a UI policy can be specific to a view. For example, you can define a UI policy for only the itil view of a form. Two fields on the UI Policy form control who can view a form.
  • Global: If the Global check box is not selected, the View field is displayed.
  • View: Select a view and the UI policy applies only to that view of the form.