window.open written in a client script and its not working on Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2016 04:36 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2016 05:48 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2016 05:55 AM
Hi Prithviaj,
Solution given by Abdul is working but its opening the link in same window . Requirement is to open links in different tabs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2016 06:06 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2016 09:41 PM
I am not able to find any application named "glide.script.block.client.globals"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2016 11:06 PM
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