Client Script Type — onChange()

  • Script runs when a particular field value changes
  • Typically used to
    • Respond to field values of interest
    • Modify one field value in response to another

An onChange() Client Script watches one field. If two fields need to be watched, a second Client Script must be configured.

For example, one onChange() Client Script populates the 'Assignment group' field if the value in the Configuration item (cmdb_cil field changes, while a second onChange() Client Script populates the Watch List if the value of the 'Priority' field changes to 1.

An onChange() Client Script runs when a particular field value changes on the form.

The onChange() Client Script must specify these parameters:

  • control — name of the object (field_name) whose value just changed. The object is identified in

    the Field name field on the Client Script form.

  • oldVaIue — value of the control field when the form loaded and prior to the change. For

    example, if the value of Assigned to changes from Matt to Miranda the value of the parameter oldValue is Matt. oldVaIue will always be Matt (the value when the form loaded) no matter

    how many times the Assigned to value changes after the original form load.

  • newVaIue — value of the control field after the change. For example, if the value of Assigned to

    changes from Matt to Miranda, the value of the parameter newValue is Miranda.

  • isLoading — boolean value indicating whether the change is occurring as part of a form load.

    Value is true if change is due to a form load. A form load means all of a form's fields changed.

  • isTemplate — boolean value indicating whether the change occurred due to population of the

    field by a template. Value is true if change is due to population from a template.

results matching ""

    No results matching ""