- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2017 09:29 AM
I am trying to open the URL for a Knowledge Article (KA) in new browser window using a UI Action in Custom Scoped Application - Jakarta
action.setRedirectURL works fine; but opening in a new window is required...
window.open('https://devXXXXX.service-now.com/kb_view.do?sysparm_article=KB0010001','_blank');
Does not work because selecting the Client option for a UI Action disables the button (in Custom Scoped Application - Jakarta)
GlideDialogWindow('https://dev10457.service-now.com/kb_view.do?sysparm_article=KB0010001', true);
has not worked either.
I have a UI policy that opens the KA in a new window:
function onCondition() {
g_navigation.openPopup('https://dev10457.service-now.com/kb_view.do?sysparm_article=KB0010001', true);
}
but cannot figure out how to make a UI policy recognize a Button click (UI action).
Also I have tried populating the value of a field within the UI Action but
g_form.setValue('u_table', field); has not worked (in Custom Scoped Application - Jakarta)
Any ideas opening a URL in new browser window using UI Action in Custom Scoped Application - Jakarta???
Thanks for your time,
Lon
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2017 07:09 PM
Thats great Lon. Can you please mark this thread answered so that it could help someone in future?
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2017 09:38 AM
Hello Lon,
In the standard forms UI (eg client scripts, client ui actions) - by default, we block access to the DOM and certain top-level globals (window, document, $ / jquery). You can enable an application-specific property to gain access to the DOM.
You can enable an application-specific property to gain access to the DOM. This provides a good tradeoff by setting a default with best practice guard rails, and allowing a developer to take explicit action to opt out of the best practice.
To opt out of the best practice create the following property in your scope and set it to false. glide.script.block.client.globals
On another note, you mentioned that "Does not work because selecting the Client option for a UI Action disables the button (in Custom Scoped Application - Jakarta)". Did you mean you are not able to select client operation in UI action for scoped application?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2017 10:12 AM
Is it not working on Service Portal?
You can write your own custom UI actions on Service Portal and get it working.
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2017 12:25 PM
I have glide.script.block.client.globals set to false in both Global & Custom scoped application.
If Client is selected the UI Action (button) stops working regardless of the code in the script field (Server or Client side scripts)
The button has a hover effect but does nothing onClick

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2017 01:04 PM
I am using it on a Service Portal widget Client Controller and it just work fine.
var link = 'kb_view.do?sys_kb_id='+$scope.data.kbsysid;
window.open(link,'popup','toolbar=0,menubar=0,width=600,height=600');
Please mark this response as correct or helpful if it assisted you with your question.