action.setRedirectURL in Client Scripts.

Stewe Lundin
Mega Guru

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. 

 

 

14 REPLIES 14

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. 

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');

}

Stewe Lundin
Mega Guru

The Issue here is apparently how I configure my URL!

 

 

I  didn't get your requirement.Could you please elaborate more. Also please provide the screenshot of the code you are actually doing.

Thanks.

Radek7
Mega Guru

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 ...