Notifications

30 views

Description

https://docs.servicenow.com/bundle/london-it-service-management/page/product/service-catalog-management/concept/c_CascadeTheOrderGuideVariables.html

https://docs.servicenow.com/bundle/madrid-it-service-management/page/product/service-catalog-management/concept/c_CascadeTheOrderGuideVariables.html

https://docs.servicenow.com/bundle/newyork-it-service-management/page/product/service-catalog-management/concept/c_CascadeTheOrderGuideVariables.html

ServiceNow provides sample code in documentation that deals with hiding cascaded variables when cascading an order guide variable. However, after implementing the sample code, cascaded variables with values are displaying on the 'Chose Options' pages of an order guide. This is not the expected behavior.

Release or Environment

London, Madrid, New York

Cause

The reason for this is that the example code under 'Hide cascaded variables' is incorrect, specifically when declaring the 'item' and 'guide' variables.

Resolution

The script that we are using from documentation is actually incorrect, as we are using $('variable') to access item and guide variables. The correct way to access item and guide is by using g_form.getControl('variable'). So 'item' and 'guide' should be declared as such in the script:
var item = g_form.getControl('current_item');
var guide = g_form.getControl('sysparm_guide');

Article Information

Last Updated:2019-10-16 09:01:52
Published:2019-10-16