Call UI script from an Onload Catalog client script

jglen
Giga Expert

Hi to everyone,

By using the documentation i've tried to call the helloword script example in a Onload Client Script but it's retrun an error : find_real_file.png

Any Idea ?

find_real_file.png

find_real_file.png

Thank you in advance,

1 ACCEPTED SOLUTION

The SN Nerd
Giga Sage
Giga Sage

If you are testing in Service Portal, you need to add the UI Script to your Service Portals Theme.

Navigate to Service Portal > Themes and select the theme being used (Stock is the default).

Then, add the UI Script via the related list JS Includes at the bottom of the form (New)

find_real_file.png

Please note that UI Scripts ran from Service Portal have no access to g_form.


ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

View solution in original post

7 REPLIES 7

Mike Patel
Tera Sage

There us typo on your OnChange script. it should be helloWorld();

The SN Nerd
Giga Sage
Giga Sage

If you are testing in Service Portal, you need to add the UI Script to your Service Portals Theme.

Navigate to Service Portal > Themes and select the theme being used (Stock is the default).

Then, add the UI Script via the related list JS Includes at the bottom of the form (New)

find_real_file.png

Please note that UI Scripts ran from Service Portal have no access to g_form.


ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

It's working !

 

Thank you very much !