Make Worknotes Mandatory , if Impact or Urgency gets updated

Pooja Khatri
Tera Contributor

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  ? 

14 REPLIES 14

Ankur Bawiskar
Tera Patron
Tera Patron

@Pooja Khatri 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar - can you please help me with the script .

@Pooja Khatri 

it's an easy one

what did you start with and where are you stuck?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

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

 

PoojaKhatri_0-1713766137046.png

 

@Pooja Khatri 

it's expected behavior right when you change the default value the work notes should become mandatory

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader