Set visible UI policy action does not work on Macro variables. It stops onLoad() client scripts and ui policies which have lower precedence for System Wizards 

Steps to Reproduce

1. Create a System Wizard called 'Test Button'
2. Create 2 pages: Page 1, Page 2.
3. Add navigation, Page 1 to Page 2 (you will use Next and Previous in this test)
4. Create a single line text field 'text1', add to both pages
Create a global UI Macro
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:sc_button classes="request_catalog_button_with_icon"
label="Print Label to Local Printer"
title="Print Label to Local Printer"

6. Create a wizard Macro Variable "test_macro" for Page 2 and refer the UI macro created in Step 5

7. Create a Wizard client script.
function onLoad() { alert('page onLoaded);}
Add to both the pages.

8. Create a Wizard client script with 2 functions to test button click.
function onLoad() {return false}
function alertMsg() {alert('Button Pressed')}
Add to both the pages

Test "Try It" and navigate to both the pages. You can see that onLoad alerts and button press alerts work as expected

9. Now, Create a UI Policy, add an action to 'test_macro', set Visible to false.
Test "Try It".

Expected behavior:
test_macro should be hidden in Page 2 and the onLoad client script for the panel, should be loaded.

Actual behavior:
test_macro is not hidden and the onLoad client script for the panel is not loaded.


Define a property "" of type True|False
Set value to "false" 

Related Problem: PRB1292101

Seen In

There is no data to report.

Intended Fix Version


Safe Harbor Statement

This "Intended Fix Version" information is meant to outline ServiceNow's general product direction and should not be relied upon in making a purchasing decision. The information provided here is for information purposes only and may not be incorporated into any contract. It is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. The development, release, and timing of any features or functionality described for our products remains at ServiceNow's sole discretion.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2018-12-03 10:43:17