
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2014 06:11 AM
We want have service now request page redirect the user to another page but I would also then like to have service now redirect to the home page. I have created a on load script that opens a new page but I cannot figure out who to get service now to go back to the home page. Here is the script I have.
function onLoad() {
window.open("http://www.w3schools.com");
action.setRedirectURL('home.do');
}
Solved! Go to Solution.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2014 06:16 AM
Since you're in a client script (not a UI action) you'll need to use something like this...
window.location = 'home.do';

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2014 06:16 AM
Since you're in a client script (not a UI action) you'll need to use something like this...
window.location = 'home.do';

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2014 04:40 AM
thank you for this, very helpful!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2014 06:24 AM
RedirectURL can be used only in Business rule.
For client script, you will need to write window.open again to redirect.
Also you can make use of document.referrer if you want to know the previous URL.
Regards,
Bhavesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2023 11:48 AM
Use this script to solve it.
@Brian Lancaster wrote:We want have service now request page redirect the user to another page but I would also then like to have service now redirect to the home page. I have created a on load script that opens a new page but I cannot figure out who to get service now to go back to the home page. Here is the script I have.
function onLoad() {
window.open("http://www.w3schools.com");
action.setRedirectURL('home.do');
}
The script you provided will open a new page with the URL "http://www.w3schools.com" using window.open(). After that, it sets the redirect URL for the current ServiceNow page to 'home.do' using action.setRedirectURL().
The ServiceNow is redirected back to the home page, make sure that the 'home.do' URL is the correct URL for your ServiceNow instance's home page. Adjust the URL as needed.