"Suspend Task" button on HR task in HR Agent Workspace
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello,
"Suspend Task" button on HR task in HR Agent Workspace is missing.
How can I modify UI Action "Suspend Task", specifically Workspace Client Script to have the same functionality as on classic view?
Thanks,
Nelli.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago - last edited 2 weeks ago
Hello @Nbruk
Steps to add the "Suspend Task" UI Action for Workspace:
- Locate the Action: Navigate to System Definition > UI Actions and find the "Suspend Task" action for the sn_hr_core_task table.
- Enable for Workspace: Ensure the Show in Workspace checkbox is checked.
- Configure for Client-Side:
- Check the Client box.
- Set the Onclick function name (e.g., runSuspendTask()).
- Create Workspace Client Script: In the "Workspace Client Script" field, implement the function to mirror the classic behavior, typically prompting for a reason and updating the state to Suspended.
function runSuspendTask() {
// Prompt for reason (optional: prompt the user for input similar to classic)
var reason = prompt("Please enter the reason for suspension:");
if (reason === null) return; // User cancelled
// Set the state to Suspended (verify your system's 'Suspended' value)
g_form.setValue('state', '3'); // Assuming '3' is Suspended
g_form.setValue('work_notes', 'Task suspended. Reason: ' + reason);
// Save the record
g_form.save();
}
If my response helped you, please click on accepted solution ✅ and consider giving it a thumbs-up 👍. This helps others find the solution faster and keeps the community thriving.
Thank you for your support! 🙏
Thanks & Regards ,
Supriya Waghmode |ServiceNow Rising Star 2025🌟
www.linkedin.com/in/supriya-waghmode
