- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2025 07:31 AM
Hi,
I have created a related list action in scoped app and is using the folowing code but window.location.href is not working. Can somebody give me the alternative code that I can use here?
function onClick() {
alert('This is a simple alert message!');
var a = window.location.href;
alert('newThis is a simple alert message!');
alert('abc'+a);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2025 08:21 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2025 08:10 AM
@MaharshiC You can utilise glide.script.block.client.globals system property and set it to false but again it is not a recommended solution due to it applying on all the scoped applications. Here is a support article around this property https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0551586
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2025 07:45 AM - edited 02-19-2025 07:47 AM
@MaharshiC window.location.href does not work ,I faced the issue long time back.
Please refer the suggestion in the link given below.
Window.location.hred in scopped App
Accept this as solution and mark my response as helpful.
Thank you,
Mahesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2025 07:47 AM - edited 02-19-2025 07:48 AM
Hello,
you can try to create a new system property in System Properties table [sys_properties] within your Application scope:
Name: glide.script.block.client.globals
Value: false
Now you should be able to access DOM in your scoped Client Script.
You can find more informations in this article: Scoped Applications and Client Scripts: A Primer
If my answer helped you, please mark it as correct and helpful, thank you 👍
Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2025 08:21 AM