how can redirect to external URL from script while creating button

manojlakshmanas
Kilo Expert

i need user to redirect to external page while clicking button.

1 ACCEPTED SOLUTION

manojlakshmanas
Kilo Expert

Hi


while pointing user to external URL page from UI Action client script this will be helpful to redirect.



        location.href = ("external page URL");


View solution in original post

21 REPLIES 21

mayurt
Tera Expert

Hi manoj,



you can use window.open as follows in your ui action :



find_real_file.png


action.setRedirectURL() will open the page in the same tab and


window.open() will open the page in new tab.



Kind regards


MT


Hi mayur tejnani,


      Thanks for the reply


        I have tried the same method you have posted but i tried to create it from private scope while performing from global scope i have navigate to URL i have given.But in private scope i am getting the ERROR "Cannot read property 'open' of null"


Since this is an old thread, this information is intended for future reference.



As Manoj pointed out here, window is not available in a scoped application. For more information: Scoped Applications and Client Scripts: A Primer
Instead, one can use GlideNavigationV3, which is referenced using the instantiated variable g_navigation.



To open a new window in a scoped application from a client-side script, use the example code below:


g_navigation.openPopup('https://www.google.com');


Hello Trevor,



I would like to know if an application using g_navigation.open(ExternalURL) can pass the certification to be on the App Store?



Thanks for your time.


Hello Hugo,



Unfortunately, I am not familiar with application certification requirements and do not have access to that information. I would assume that it is okay since that implementation follows official documentation. However, opening external URLs always creates additional security concerns as the destination could be malicious or made malicious through an attack.



Sorry that I could not be of more assistance.