Agent Workspace Issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2025 02:28 PM - edited 02-19-2025 02:44 PM
Hello,
I'm trying to create a UI action that export an HR case record in both the case form in the native UI and Agent Workspace. The UI action works correctly in the native UI but does not function properly in Agent Workspace.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2025 08:46 PM
Hi @Michael94
Good day.
Instead of using openPopup(url), use top.window.open(url,"_blank").
It's working fine for me.
Thanks,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2025 07:43 AM - edited 02-16-2025 08:05 AM
Thanks, I tried it but still not working. I found this article by @Musab Rasheed, however I'm not sure what I'm missing:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2025 09:28 PM
use this
function onClick(g_form) {
exportPDF();
function exportPDF() {
var hrService = g_form.getValue('hr_service');
var gaViewName = new GlideAjax('sn_hr.validateService');
gaViewName.addParam('sysparm_name', 'getViewName');
gaViewName.addParam('sysparm_service',hrService);
gaViewName.getXML(getView);
}
function getView(response) {
var instanceURL = "https://"+location.hostname+"/";
var sysparm_view = response.responseXML.documentElement.getAttribute("answer");
var sysparm_table = g_form.getTableName();
var sysparm_sys_id = g_form.getUniqueValue().toString();
var url = instanceURL +'sn_hr_case.do?PDF&sys_id=' + sysparm_sys_id+'&sysparm_view='+sysparm_view;
open(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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2025 07:53 AM
Thanks, I tried but still not working.
I'm using almost the same script for the UI action Script and for the Workspace Client Script. What do you think about the URL? Don't you think Agent Workspace may require a different URL format for opening the PDF?