
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2016 11:37 AM
In the Incident Management application, how do I make the worknotes mandatory when the priority changes.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2016 12:43 PM
Hi Robin,
Follow below steps to make work notes field mandatory on change of priority.
Select Table name: Your table name (e.g. Incident)
Type: onChange
Field Name: Priority
Script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Clearing the value of Owner field on change of Owner Group
if(newValue != oldValue)
g_form.setMandatory('work_notes',true);
}
Hope this will help you.
Regards,
Swapnil
PS: Hit like, Helpful or Correct depending on the impact of the response

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2016 12:14 PM
Hi Robin,
Create a client script on incident table with field as Priority.
And copy the below code:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
if(oldValue != newValue)
{
g_form.setMandatory('u_price',true);
}
}
Refer : Client Scripts - ServiceNow Wiki
Thanks
Akhil
Hit Like/Helpful/Correct, if applicable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2016 12:17 PM
use work_notes field name instead of u_price

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2016 01:15 PM
Is there a way to do it without writing a script?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2016 01:25 PM
I guess no because firstly i thought of using ui policy but was not able to find any condition such as priority changes, then only mentioned via script.