- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2022 08:53 AM
I have the script below that I use on an Onchange in a scope application. However, the script is not working. Any feedback? Looks like window is not supported according to Service Now but do not know what I need to replace it in order to trigger the redirect URL? Help appreciated.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if(newValue == 'SNOW access request')
var redirectURL ='https://snedge-lmscdev026.external.lmco.com/service_central_portal?id=sc_cat_item&sys_id=e661fb491b84cd90687365ffe54bcb6d&sysparm_category=5c1980c1dbe37b40ca073efd7c961927';
top.window.location = redirectURL;
}
Luis Roman Lockheed Martin
Solved! Go to Solution.
- Labels:
-
Script Debugger
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2022 10:33 AM
Hi
top.location.href = redirectURL;
Please check and let us know.
Thanks 🙂
Shakeel Shaik 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2022 10:29 AM
this should do the trick if it is on the portal:
location.href = redirectURL;
Best regards,
Sebastian Laursen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2022 10:33 AM
Hi
top.location.href = redirectURL;
Please check and let us know.
Thanks 🙂
Shakeel Shaik 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2022 10:36 AM
Hi
similar question, Have a look
window.location.href is not working in Client Script
Shakeel Shaik 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2022 12:36 PM
THank you all for the guidance. Now that the script is working I am getting a save message before the redirect. Is there any script command that I can add to hide the message?