action.setRedirectURL in Client Scripts.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2018 04:14 AM
I have UI Action button I want to trigger
var url='/myurl.do' ;
action.setRedirectURL(url);
The UI Action triggers, but it will not load my URL
action.setRedirectURL(url); works from my UI page ClientsScript but not from the UI Action.
Is there another way to solve this.
Showing a dialog in not an option.
A new window could work, but preferable the main window.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2018 03:36 AM
Yes the Alert Works fine,
the uri was a copy / paste misstate mistake its not an issue.
I can't read you text in the image.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2018 03:57 AM
function getIds(){
// var aa=g_list.getChecked();
// // this will return comma seperated sys_id
// alert(aa);
// var ids=aa.split(',');
// for(var i=0;i<ids.length;i++){
// //write your code
// }
location.href='/sp?sysparm_stack=no&sysparm_cancelable=true';
//action.setRedirectURL('https://dev51132.service-now.com/sp?sysparm_stack=no&sysparm_cancelable=true');
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2018 05:15 AM
The Issue here is apparently how I configure my URL!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2018 06:18 AM
I didn't get your requirement.Could you please elaborate more. Also please provide the screenshot of the code you are actually doing.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2022 09:49 AM
It is working if you open your url in new tab, without SN left menu(aplication navigator - not in the servicenow old window) and then you copy this url to your code.
It seems it has problem with menu in the menu ...