clear fields when category changes

carlh
Kilo Guru

Hi All,

I'm working on Incident and have come across something I didn't think about.   There are times when an incident is reported under the incorrect category and it needs to be corrected.

For example, there is an issue with a phone and the incident is reported as a hardware issue but in reality it's something to do with the phone line.   In this case we want to change the category to the proper one but there is an issue.   It is possible that the creator filled in required fields based on the original category and that is causing the UI Polices and Actions to be triggered making the form a big mess.

Is there a way to clear all fields when a category changes?

I'd need a script example if there is.

Psuedo Script in my head is:

If "Category" changes to anything, Clear all fields that have been populated

Please let me know if you have ideas or input or examples!   thank you

Carl

6 REPLIES 6

Hello @Abhinay Erra ,

 

I have tried using your above script for onchange client script but it is not working for me.

Can you advise on this please.

find_real_file.png

the field I have put in the array to clear, they are no longer showing up now.

when selecting the categories, the fields are not displaying now. It is due to this client script.

I have a UI policy on each category, dont know if that makes a difference?

find_real_file.png