Build information:
This is a regression in Jakarta and does not happen in Istanbul.

Issue Description:
When a client script calls g_form.clearValue on a select Box or Yes/No variable, a change is detected and triggers any onChange client scripts for that field even though the value does not change. In Istanbul, this does not happen.

Investigations carried out so far and any findings:
This does not happen if the Use None option is selected on the select box variable.

Steps to Reproduce


Include pre-requisites when reproducing the issue on a default version demo instance. For example, activating a certain plugin.

  1. Create a new Catalog item
  2. Create a variable of type checkbox named field1
  3. Create a Variable of type Yes/No named field2
  4. Create an onChange client script for when field1 (the checkbox) changes with this line of code added.
    • g_form.clearValue('field2');
  5. Create an OnChange client script for when field2 change with this line added.
    • g_form.addErrorMessage("Field 2 has changed");

Try the item and notice when the box is checked, the error message is displayed. Therefore, onChange client scripts for the field are being triggered, when doing a g_form.clearValue.

Because the value of the yes/no or select box is not changing, we should not call onChange client scripts.

However, in Jakarta we do call onChange scripts.


As a workaround, use Include None under Type Specification for the variable of type Yes/No or Select Box where this issue is being faced. 


Related Problem: PRB1194586

Seen In

Jakarta Patch 3

Intended Fix Version


Fixed In

Jakarta Patch 4 Hot Fix 1
Jakarta Patch 7
Kingston Patch 1

Safe Harbor Statement

This "Intended Fix Version" information is meant to outline ServiceNow's general product direction and should not be relied upon in making a purchasing decision. The information provided here is for information purposes only and may not be incorporated into any contract. It is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. The development, release, and timing of any features or functionality described for our products remains at ServiceNow's sole discretion.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2018-03-02 00:47:09