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-16-2025 06:59 PM
did you add console.log() in workspace client script and see if you got ajax response?
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-17-2025 11:54 PM
The ajax response in workspace client script is returning [object, Object]. But the UI action works fine in native.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2025 12:01 AM
are you able to form the URL correctly in workspace client script?
can you try 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.getXMLAnswer(function(answer) {
var sysparm_view = answer;
var sysparm_sys_id = g_form.getUniqueValue().toString();
var url = '/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-18-2025 12:25 AM
No, I can't form the URL in workspace client scrip.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2025 12:46 AM
please check the script I shared.
did you try adding console.log() and see what was returned from script include function
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