Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Open URL onclick ui action button

XYD23
Tera Contributor

Requirement is:
When I click on the Ui action button on a form,
a URL should open in a new tab of that particular browser.

1 ACCEPTED SOLUTION

Anand Kumar P
Giga Patron

Hi @XYD23 ,
i have tried working fine in my pdi.

AnandKumarP_1-1701678043149.png

 

AnandKumarP_0-1701678005544.png

function exportPDF() { 
 
 var instanceName='https://www.w3schools.com/';
 g_navigation.openPopup(instanceName);
} 

Please mark it as solution proposed and helpful if it serves your purpose.

Thanks,

Anand
 

View solution in original post

7 REPLIES 7

Anand Kumar P
Giga Patron

Hi @XYD23 ,
i have tried working fine in my pdi.

AnandKumarP_1-1701678043149.png

 

AnandKumarP_0-1701678005544.png

function exportPDF() { 
 
 var instanceName='https://www.w3schools.com/';
 g_navigation.openPopup(instanceName);
} 

Please mark it as solution proposed and helpful if it serves your purpose.

Thanks,

Anand
 

Gunjan Kiratkar
Kilo Patron
Kilo Patron

Hi @XYD23 ,

 

You can something like below :

GunjanKiratkar_0-1701678177920.png

function hitURL(){
top.location.href='https://www.google.co.in';
}

Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy

Prince Arora
Tera Sage

@XYD23 

 

If UI action is "Server Side", use 

action.setRedirectURL("YOUR_URL_HERE");
 
If UI action is "Client Side", use:
g_navigation.openPopup("https://google.com/");

 

PrinceArora_0-1701678399754.png

 

 

If my answer solved your issue, please mark my answer as  Correct & 👍Helpful based on the Impact.