UI Script not working in new Service Portal

Katie A
Mega Guru

Hello, I am trying to create a very simple UI script such that I can write re-usable functions to call use with client scripts.

Global UI scripts

The simple UI script works fine on the CMS. However it DOES NOT work in the Service Portal.

Are UI Scripts no longer supported in the Service Portal? We are on Helsinki.

Catalog Client Script

UI Type: BOTH

function onLoad() {

    helloWorldTest();

}


UI Script

Global: TRUE

function helloWorldTest() {

  alert('Hello World');

}

1 ACCEPTED SOLUTION

nathanfirth
Tera Guru

b-rad That is incorrect, you can add UI Scripts to the Service Portal through the Theme. The theme has a related list of JS files, which if local is a reference to the UI Script table.



I would not recommend making the UI Scripts Global.


View solution in original post

9 REPLIES 9

Brad Tilton
ServiceNow Employee
ServiceNow Employee

Update: Removed my incorrect answer to clear up confusion. Always trust Nathan's SP answers over mine anyway 🙂

 

MEH. Thanks Brad, as always!


nathanfirth
Tera Guru

b-rad That is incorrect, you can add UI Scripts to the Service Portal through the Theme. The theme has a related list of JS files, which if local is a reference to the UI Script table.



I would not recommend making the UI Scripts Global.


Thank you Nathan! Is there any documentation available on how to set that up?