- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2012 03:36 AM
Can we redirect to any other page or homepage using client script.
I need that if the IF condition true then redirect to homepage.Please help me out
Solved! Go to Solution.
- Labels:
-
Change Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2019 12:44 PM
I know this post is old and Harsh might have got his answer but just in case someone stumbles upon this post and looking for a way to redirect using client script then below code snippet might help:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
if (newValue == 'expense_freight_realestate'){
var redirectURL = 'https://www.google.com/'; //url to redirect; this approach works in platform and Service Portal view
top.window.location = redirectURL ;
}
}
Please note that in case you want to open up external link within the main ServiceNow Frame then you may use g_navigation.open() but this approach doesnt work when the Service Catalog/form will be used in Service Portal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2015 11:17 AM
Nopes, does not work for internal url as well.
getTopWindow().NavPageManager.get().getPane('gsft_main').loadLinkFromUrl("https://dev10405.service-now.com/incident.do?sys_id=-1&sysparm_query=active=true&sysparm_stack=incid...");
Window.location is working fine.
Regards
Pratul Agarwal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2015 08:47 AM
Remove the instance part, we expect it to be internal anyway
getTopWindow().NavPageManager.get().getPane('gsft_main').loadLinkFromUrl("/incident.do?sys_id=-1&sysparm_query=active=true&sysparm_stack=incident_list.do?sysparm_query=active...");
This way it is also portable between instances using our update sets without the need for change.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2016 05:46 AM
Has this changed with Helsinki/U16? Getting complaints about .get(): Cannot read property 'get' of undefined

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2017 05:03 AM
Are you working in a scoped app?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-05-2018 08:56 AM
I'm in Global, and it seems that both NavPageManager and g_navManager doesn't work anymore.