window.open written in a client script and its not working on Service Portal

prabh
Mega Expert

Hi Folks,

I have a catalog item and in that there is onchange client script which opens different URLs based on the value selected using window.open() function.

But this script is not working on Service Portal. I have changed the UI type of the script to "Both" as well.

Please help.

Thanks

Preety Arora

23 REPLIES 23

Hi,



you need to ship a True/False system property in your application named glide.script.block.client.globals with the value false


This should solve your problem



Thanks.


Hi Prithviaj,



Solution given by Abdul is working but its opening the link in same window . Requirement is to open links in different tabs.


Hi,



Fr that the target attribute needs to e set to "_blank". I don;t know how to do that using window.top.location but using window.open you can do it like this


window.open("<link>","_blank");



Thanks


I am not able to find any application named "glide.script.block.client.globals"


Hi,



glide.script.block.client.globals is a property that you have to add in the system properties table. See here for instructions on Adding a Property - ServiceNow Wiki. And the application is the application you are working on. ie. the one displayed on the top right hand corner of the page.



Thank you