Unable to Set "Work Notes" mandatory for sc_task table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
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');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
your code should be proper and UI action should be client side
g_form.setMandatory('work_notes', true);
š” 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
an hour ago
Create a new UI policy on sc_task table to make Work Notes Mandatory when State Changes to Closed Complete .
- Ensure in your UI Policy , OnLoad checkbox is False
- Add UI Policy condition as request Item.cat Item is <your catalog item>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago - last edited 56m ago
Hello @CharanV66187530
If you can share your use-case then maybe alternative solutions can be proposed however if you really need code for UI Action to work as client side, then use below and ensure no spelling mistakes:
function onClick() {
g_form.setMandatory('work_notes', true);
if (!g_form.getValue('work_notes')) {
g_form.showFieldMsg('work_notes', 'Work Notes is mandatory', 'error');
return false;
}
return true;
}
Hope that helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
46m ago
@Vishal Jaswal @Tanushree Maiti @Ankur Bawiskar , I have written correct format by using UI Action but not able to make 'work_notes'. The Ui action making "Notes" section mandatory. Kindly help on this.
Created UI Action on "sc_task" table
