How to make suspend reasons mandatory on click of suspend button?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2025 03:22 AM
Requirement: For parent work order, suspended reasons field (sla_suspended_reason) should be mandatory at the time of clicking suspend button.
UI Action Script:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2025 04:15 AM
this is an OOB UI action
You cannot make it mandatory using server side.
You will have to make it client + server
if (current.work_notes != '') {
new StateFlow().processFlow(current, '7e82e738d7230100fceaa6859e61037d', 'manual');
} else {
gs.addErrorMessage(gs.getMessage('Provide a reason for suspension in Work notes'));
}
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-03-2025 04:20 AM
Can you provide the code and steps? @Ankur Bawiskar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2025 04:28 AM
why to update OOB UI action?
I won't recommend that.
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-03-2025 04:48 AM
I want to make field mandatory on click of UI Action, would clone this UI action but would need help in code @Ankur Bawiskar