removeOption does not worth through client script access to variable fields on task records


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.removeOption is not supported.

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

 


Related Problem: PRB626041