Redirect to a url from a client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2017 02:11 PM
Hi Folks,
I am currently working on a catalog item where my client script needs to trigger an alert to confirm OK or Cancel.
Cancel should redirect the user elsewhere. I see that window.location does not work in the service portal
It works perfectly on the back end but not on the portal.
var okCancel = confirm('The message ');
if(okCancel == true)
{
return false;
}
else
{
window.location = theURLitNeedstoGoto;
}
Thank you.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2017 02:19 PM
Hello Sean,
You may find the below thread helpful.
ServicePortal - Redirect to home page after form successful submission submission?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2017 02:20 PM
Please check if this helps : Can we redirect using client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2017 02:22 PM
Hello Sean,
Did you try top.window.location?
How can I redirect a user with an onChange client script?
Cheers,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2018 11:45 PM
This worked for my case.
Cheers