UI Action Button
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2023 05:28 PM
I am creating a Client-side button that will take users to a URL in a tab when it is clicked. I am having two issues with this. The first is the button is not doing anything, below I put the code that it is using. I have tried the method below and using window.open() and neither have worked for me.
The second is that the button does not appear in the Employee Center and is only appearing when I click Open in Platform.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2023 09:00 PM
Hi @tzsabre
You can call the function in "Onclick" field on form instead of condition field.
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2023 09:28 PM
Hello @tzsabre,
You have called openWindow() from the condition, You have to call it from Onclick. Please find below screenshot
You can also write openPopup() as below
g_navigation.openPopup(url, "Google", 'resizable,scrollbars,status');
// Google is name of window
// resizable, scrollbars, status are features of window
Please mark my answer helpful, if it helps you
Thank you
Thank you
G Ramana Murthy
ServiceNow Developer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2023 09:57 PM
Hello @tzsabre ,
Screenshot for reference.
Script :
If my answer helped you, please mark it as correct and helpful.
Thanks & Regards,
Sayali Gurav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2023 10:05 PM
the script looks good and it will work only in native.
It won't work in portal since client side UI actions don't work in portal.
You can make the UI action as server side and redirect using this
action.setRedirectURL(url);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader