Make UI Action open a URL in a new tab in the browser.

Egil Kjørstad
Tera Contributor

I have a UI Action as a link on a form.
When clicked, the UI Action should open a URL in a new tab in the browser.
Seems like a simple thing, but I can't figure it out ...

In many cases the Community suggests window.open(url, '_blank'); -> don't work because not defined
Some suggest top.window.location = url; -> no reaction when executed
Then I found GlideNavigation - Client, but I can't make it work

My code:
function openURL() {
alert("Test"); //Popup ok, means the function is executed
url = 'https://google.no';
g_navigation.open(url); //No reaction and no error!
top.window.location = url; //No reaction and no error!
}

Can you give me a solution to this problem?

1 ACCEPTED SOLUTION

Hello,

 

All the codes provided above are working on my instance. 

You can try below as well may be this one works for you:

g_navigation.openPopup(url);

 

If my answer has helped you in any way please mark it as correct or helpful.

View solution in original post

8 REPLIES 8

Vishwa Pandya19
Mega Sage

Hello,

 

Try below code

function openURL() {
alert("Test"); //Popup ok, means the function is executed
var url = 'www.google.com';
window.open(url,'_blank');
}

 

If my answer has helped you in any way please mark it as correct or helpful.

Thank's for your answer, but I can't get the code to work:

function openURL() {
    alert("Test"); //Popup ok, means the function is executed
    var url = 'www.google.com';
    window.open(url, '_blank'); // --->No action - no error
    alert("Test 2"); //--->No action - doesn't show the popup
}
--
Any idea on what I'm doing wrong?

This is the UI Action configuration:

EgilKj_rstad_0-1715070395496.png

 

Hello,

 

All the codes provided above are working on my instance. 

You can try below as well may be this one works for you:

g_navigation.openPopup(url);

 

If my answer has helped you in any way please mark it as correct or helpful.