- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2026 06:38 AM
Hi @everyone,
Can any one help me on how to make mandatory "work notes" in sc_task table by using UI action. I tried i am able to set "Notes" section instead "work Notes".
function onclieck(){
g_form.setmandatory('work_notes');
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
We have to use both Client Script and Script Include to make mandatory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2026 07:27 AM
As already said your syntax is wrong
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2026 07:34 AM - edited 05-07-2026 07:35 AM
In Ui Policy ->Script tab->Execute if true,
write it and check:
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2026 07:50 AM
Hello @CharanV66187530
1. The spelling of click is incorrect.
2. When you use setMandatory('field_name', 'you specify here as true or false');
Hope that helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2026 08:23 AM
Work Notes is not a normal field, it belongs to journal fields.
g_form.setMandatory() does not work reliably on journal fields like work_notes and comments. That’s why it’s not enforcing.
Use g_form.getValue() and block submission. Try below code it may work for you
function onClick() {
var notes = g_form.getValue('work_notes');
if (!notes) {
g_form.addErrorMessage('Work Notes is mandatory');
return false; // stop action
}
// allow action
return true;
}
Regards,
VaniMadhuri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
We have to use both Client Script and Script Include to make mandatory.