UI Action setRedirect not working on external link

tahnalos
Kilo Sage

While trying to do a action.setRedirectURL to an external link, when I run the UI action, nothing happens.  ServiceNow goes to a blank screen.

Code is as follows but I am at a loss as to understand why this is happening:

var url = 'http://www.yahoo.com';
action.setRedirectURL (url);

The Yahoo Link is just there for show and it won't go to the URL itself.  This has been set up to be a non-client UI action so I'm not sure what I'm missing.

Thanks.

21 REPLIES 21

Thanks for your help.  But noticing that g_navigation does not work in a mobile environment.  Is there any alternative for this?  I am aware of Mobile UI Actions and do believe there is a separate function for web navigation for mobile.

It's all in the API 😉 

https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=CN-goto_S_CNR

 

You'd need to create a separate UI action for mobile only with this code.

 


ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

Does mobile UI Action allow for GlideAjax?  Also, the documentation for Cabrillo is for Kingston and it looks like Istanbul is not supported.  Are there any alternatives?

GlideAjax should be supported on mobile.

 

I can't think of any alternatives really.


ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

Ok so I see that Cabrillo can be used on Istanbul, but can someone tell me how to instantiate it?  When I use the code used in that link, the compiler spits out a syntax error.