Make Worknotes Mandatory , if Impact or Urgency gets updated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2024 10:37 PM
Hi All ,
I have a requirement , where I need to make work-notes mandatory when the values of impact or urgency field changes.
The default value of Impact = 5 and Urgency = 5 which will be set when the incident form is opened , I want the work notes to be mandatory only if the default values for impact or urgency is changed .
If the Save or Update buttons are clicked after changing the Impact or Urgency values and before typing a Work note, then an error should be displayed . . . The following mandatory fields are not filled in: Work notes .
How can I implement this scenario ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2024 10:52 PM
you can use onSubmit client script and check if either of the field changes and if work notes is empty then show alert and stop form submission
OR
you can use onChange client script on both the fields and show alert and make work notes mandatory
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
04-21-2024 10:59 PM
Hi @Ankur Bawiskar - can you please help me with the script .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2024 11:01 PM
it's an easy one
what did you start with and where are you stuck?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2024 11:10 PM
Hi @Ankur Bawiskar - I have written the below onChange client script on impact and urgency field :
But the issue which I am facing here is , when I open the incident form and then I just change the default values without clicking on save or update an incident its making the work notes mandatory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2024 11:12 PM
it's expected behavior right when you change the default value the work notes should become mandatory
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader