21 views

Description

g_form.setValue does not set the value for multiple choice in Service Portal

Steps to Reproduce

  1. Create a catalog item with two multiple choice variables
    Variable 1: impact
    Variable 2: urgency
  2. Create 3 choices for each variable
    Choice 1: Value = 3
    Choice 2: Value = 2
    Choice 3: Value = 1
  3. Set the default value to 3 for both variables
  4. Create an onChange catalog client script with the following details:
    Variable Name: urgency
    UI Type: All
    Applies on Catalog Item View, selected.
    Script:
    if(newValue == 1 && g_form.getValue("impact") == 1){
    //g_form.showFieldMsg("urgency","Please phone the Service Desk if your issue if critical in nature");
    g_form.hideErrorBox("urgency");
    g_form.showErrorBox("urgency","Please phone the Service Desk if your issue if critical in nature");
    //Prevent form from setting empty values
    /*g_form.clearValue("urgency");
    g_form.clearValue("impact");*/
    //Set values
    g_form.setValue("impact","1");
    g_form.setValue("urgency","2");
  5. Access the catalog item from service portal
  6. Set impact to 1
  7. Set urgency to 1
    Result: The first time, it sets the urgency value to 2 which is the expected behavior.
  8. Set the urgency back to 1.

    Result: The value is no longer set. This works in the normal Service Catalog UI

Workaround

This issue is under review. To receive notifications when more information is available, subscribe to this Known Error article by clicking the Subscribe button at the top right of the article. If you are able to upgrade, review the Fixed In field to determine whether any versions have a permanent fix.


Related Problem: PRB1240932

Seen In

There is no data to report.

Intended Fix Version

Madrid

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-07-26 11:26:00
Published:2018-07-26