67 views

Description

For forms where variables are shown, for example, sc_req_item, using removeOption in a client script to remove an option from a variable field in a client script will not work.

Note that the catalog client script has no issues with this method when running on com.glideapp.servicecatalog_cat_item_view.do.

Steps to Reproduce

  1. Go to the sc_req_item table and go to the Blackberry catalog item.

  2. Add a new variable select box named "test_var".

    For more information, see the product documentation topic Create a Service Catalog variable.

  3. Add three choices to the variable named "choice_one", "choice_two", and "choice_three".

  4. Create a new client script with the following values:

    • Type: onLoad
    • Table: sc_req_item
    • Script:
      function onLoad() {
      g_form.removeOption('variables.test_var','choice_one');
      }
  5. Submit a new Blackberry catalog.

  6. Go to the request item form.

    The test_var variable should contain only two choices but three choices are available including choice_one, which should have been removed.

    Workaround: g_sc_form.removeOption('test_var', 'choice_one');

 

Workaround

Note that only the following APIs are supported:

  • g_form.setDisplay(name, display)
  • g_form.setVisible(name, visibility)
  • g_form.setMandatory(name, mandatory)
  • g_form.setValue(name, value, display_value)
  • g_form.getValue(name)
  • g_form.setReadOnly(fieldName, boolean)

g_form.removeOption is not supported.

For more information, see the product documentation topic Client script access to variable fields on task records.

 


Related Problem: PRB626041

Seen In

Eureka Patch 5
Helsinki Patch 3

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2018-07-01 01:44:45
Published:2018-07-01