Using window.open() from a ui action within a scoped application

Eric Johansson
Mega Guru

Hi everyone,

I have a scoped UI Action to open an external link.  I am using window.open(url) which will not work within a scoped app.  As per https://hi.service-now.com/kb_view.do?sysparm_article=KB0551586, I have created a system property glide.script.block.client.globals and set it to false. The system property is in the application scope and prefixed with the app name as required.  Alas this does not work for me.  Has anyone out there got any ideas on how I can get this to work or know of another way to achieve this?  

If I change the UI Action to global scope it will work, but his is not desirable. I have also tried g_navigation.openPopup(url); without success. 

Many Thanks

Eric

1 ACCEPTED SOLUTION

SanjivMeher
Kilo Patron
Kilo Patron

g_navigation.openPopup(url); should work.

Can you confirm, you marked the UI action as Client and added function name to onClick field.

And g_navigation.openPopup(url); should be inside that function


Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

4 REPLIES 4

Siddartha Gudim
Tera Guru

Found that there is an API called g_navigation through which we can perform some DOm related tasks,

I am currently using the following code in my client script of UI action

g_navigation.openPopup(url);

 

Please mark helpful or correct based on the impact of the response.

 

Regards,

Sid.

Hi Sid,

Thank you for your reply.  I have tried g_navigation.openPopup(url); as suggested in other forums but have not been able to get this to work either.

 

kind regards

Eric

SanjivMeher
Kilo Patron
Kilo Patron

g_navigation.openPopup(url); should work.

Can you confirm, you marked the UI action as Client and added function name to onClick field.

And g_navigation.openPopup(url); should be inside that function


Please mark this response as correct or helpful if it assisted you with your question.

Hi Sanjiv,

Thank you,  I did not have function name in the OnClick field.

Kind regards

Eric