Custom UI action not working on FSM workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2025 02:24 AM
I created a custom UI action: requested raised and configured in both workspace and native UI. but the custom ui action is not working either on workspace/native UI.
issue: even after clicking OOB 'save' or 'update' action on workspace, the server side of custom UI action runs every time whenever there is any updates made to the form.
expected: custom UI action should work both on client side and server side only when it is clicked.
UI action: 'Request raised'
client : true
server(insert/update) - true
script:
workspace client script:
please help to resolve this issue as i am unable to fix this issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2025 02:28 AM
what debugging did you do?
share your UI action configuration screenshots
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
‎05-05-2025 03:04 AM
Hi @Ankur I have added logs in server script of above UI action. but it's still getting executed every time any updates/changes made on the form.
I also added 'g_form.getActionname() === 'request_raised' but still having the same issue.
thanks,
Abhi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2025 03:17 AM
did you check any OOTB UI actions?
Ideally your script should work fine
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
‎05-05-2025 03:47 AM
it worked for me in both native + workspace, see below I got info message present in server side both the times.
Script:
function showFunction() {
alert('inside normal client script');
var url = '/' + 'incident' + '.do?PDF&sys_id=' + g_form.getUniqueValue() + '&sysparm_view=workspace';
alert(url);
top.window.open(url, "_blank");
gsftSubmit(null, g_form.getFormElement(), "export_pdf");
}
if (typeof window == 'undefined')
runBusRuleCode();
function runBusRuleCode() {
gs.addInfoMessage('server side');
}
Workspace client script:
function onClick(g_form) {
var ans = confirm("Do you want to move ahead?");
if (ans == true) {
alert('inside workspace client script');
var url = '/' + 'incident' + '.do?PDF&sys_id=' + g_form.getUniqueValue() + '&sysparm_view=workspace';
alert(url);
open(url, "_blank");
g_form.submit(g_form.getActionName()); // matching the UI action name
}
}
Output:
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