I need to create a 'cancel' Ui button in the incident form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2026 07:21 AM
using Ui actions, I need to create a cancel Ui button in the service operations workspace, when we click cancel button, it should cancel incident and state should move to cancel state, by adding work notes as well, guide me the step-by-step process and script.
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2026 07:37 AM - edited 04-16-2026 07:40 AM
Hi @suryaogeti1,
what you have tried yourself. COuld you possibly share your blockers, errors or your UI Action to review? :))
This is not to do your job but rather to get support, but the efforts shall go both ways
EDIT: you can just change the state, add comment and save it no?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2026 07:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2026 08:02 AM
Hi @suryaogeti1 ,
I was able to implement this successfully in Service Operations Workspace using a UI Action.
Approach:
- Created a UI Action on the Incident table
- Enabled Workspace Form Button
- Used Workspace Client Script to trigger the action
- Used server-side script to update the record
Workspace Client Script:
if (!confirm("Are you sure you want to cancel this incident?")) {
return;
}
g_form.submit('cancel_incident');
}
Server-side Script:
current.work_notes = "Incident cancelled by " + gs.getUserDisplayName();
current.state = 8; // Cancel
current.close_code = "Closed/Resolved by Caller";
current.close_notes = "Incident cancelled";
current.update();
action.setRedirectURL(current);
}
Result:
- Clicking Cancel Incident shows a confirmation popup
- On confirmation:
- Incident state moves to Canceled
- Work notes are added
- Record updates successfully in Workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2026 09:06 AM
Hi @suryaogeti1
Step by step instruction is given in this community post.
Refer : Create a cancel button in SOW