1041 views

Description

setVisible is not working on catalog client scripts and does not hide variables in Service Portal.

Steps to Reproduce

 

  1. Navigate to Service Catalog > Catalog Variables > Variable Sets.
  2. Click New to create a new Variable Set.
  3. Add a name, right-click the header, and Save the form.
  4. Under the Variables tab, click New to create a new variable set.
  5. On the Type field, choose Single Line Test.
  6. Under the Question tab, enter a question and name.
  7. Right-click the header and Save the form.
  8. Create an OnLoad Catalog Client Script to Hide the variable from the variable set:

    function onLoad()
    {
    //Type appropriate comment here, and begin script below
    g_form.setVisible('testVS', false);
    }

  9. Open record producer Emergency Change: https://xxxx.service-now.com/nav_to.do?uri=sc_cat_item_producer.do?sys_id=389d27110a0a0b27004f344ed8a38ee4
  10. In the Related Links section under the Variable Sets tab, add the newly created variable to the record producer.
  11. Right-click the header and Save the form.
  12. Click the Try It button and note that the variable set is hidden:



  13. From the Service Portal home page, navigate to Service Catalog > Can We Help You? > Emergency Change and note that the variable set is displayed on the form. This expected behavior is the same outside of Service Portal; however, setVisible does not work in Service Portal: 

Workaround

This issue is under review. If you are able to upgrade, check the Fixed In field below to determine the versions that have a permanent fix. You can also subscribe to this known error article (click the Subscribe button at the top of the article) to receive notifications when more information is available about this issue.


Related Problem: PRB901828

Seen In

There is no data to report.

Fixed In

Kingston

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2018-07-03 07:27:31
Published:2017-05-04