best practice to create mandatory fields is UI policy why?

sangeethasingh1
ServiceNow Employee
ServiceNow Employee

I heard that best practice to create field as mandatory is UI policy and not client script. Why is it so?

Can you please let me know performance issues if any?

Thanks

Sangeetha

15 REPLIES 15

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Sangeetha,



Also please refer.


Client Script Best Practices - ServiceNow Wiki


I think I might know the guy who wrote that page. 😉


tumblr_mowjer5HDD1s9frcro1_500.gif


bernyalvarado
Mega Sage

Hi Sangeetha,



A best practice overall is to avoid client scripts as much as possible.



For making fields mandatory, when possible, UI policies are always the best option. One caveat that UI policies currently have is that these do not support dot-walking a field for a condition. For instance, for a requirement like... make X incident field mandatory based on the condition of a property of a selected CI at the time this is picked within the incident form. For such type of situations you will need to use a client script.



Thanks,


Berny


Anurag Tripathi
Mega Patron
Mega Patron

The best reason i think on top of my head is that: Ui policy is out of the box way to control fields behavior. SN also emphasizes on go for configuring items rather than scripting for everything.That is the advantage of using a Tool.


-Anurag