In Service Portal, if a '-- None --' option already exists in the upon form load (that is, the variable has the "Include none" option enabled), multiple '-- None --' options display in the targeted field after using the g_form.addOption() function on it.

This might occur, for example, if you are using this function to add an option to a select box variable in a Catalog Client Script.

Steps to Reproduce


  1. Log onto the instance as an administrator.

  2. Navigate to System Definition > Plugins and ensure that the Service Portal for Enterprise Service Management (com.glide.service-portal.esm) plugin is installed.

  3. Navigate to Service Catalog > Catalog Definitions > Maintain Items.

  4. Open the catalog item Apple iPhone 5.

  5. In the Catalog Client Scripts related list, click New.

  6. Enter the following values in the fields and click Submit.

    Name: Test for PRB725642
    Type: onLoad
    UI Type: Both
    Script: function onLoad() { g_form.addOption('carrier', 'FOO', 'BAR'); }

  7. Open the Apple iPhone 5 item from the Service Catalog (/com.glideapp.servicecatalog_cat_item_view.do?v=1&sysparm_id=0d08837237153000158bbfc8bcbe5d02).

  8. Open the Apple iPhone 5 item from the Service Catalog on Service Portal (/sp?id=sc_cat_item&sys_id=0d08837237153000158bbfc8bcbe5d02).

    Note that the Service Portal view of the catalog item displays two -- None -- options in the Allocated carrier select box.


Perform a call to g_form.clearOptions() on the targeted element before ANY calls to the g_form.addOption() function are made. The call to g_form.clearOptions() needs to be made only once per form load.

Related Problem: PRB725642

Seen In

Helsinki Patch 5
Helsinki Patch 6 Hot Fix 1

Fixed In


Associated Community Threads

There is no data to report.

Article Information

Last Updated:2017-09-08 00:38:19