make a section mandatory

smithcorey
Giga Contributor

What would be a way to set a field (or fields) mandatory on a section, once the section is visible?

 

I have a UI Policy to show / hide the section based   upon state (working nicely), but when the section is shown, how do I make fields on that section mandatory?

4 REPLIES 4

darius_koohmare
ServiceNow Employee
ServiceNow Employee

Hi Corey,


You can define these fields to be mandatory globally (if you always want them to be) based off the Dictionary on these items.


Right click the field you wish to make mandatory and select Personalize Dictionary.


Screen Shot 2014-11-05 at 4.07.21 PM.JPG


From the dictionary view select the Mandatory checkbox.


Screen Shot 2014-11-05 at 4.09.26 PM.JPG



Alternatively, for just the section, why don't you set your UI policies so that the fields become mandatory following the same logic that the section should appear?


Screen Shot 2014-11-05 at 4.18.44 PM.JPG


SeanM1
Tera Guru

You can also make the field mandatory within the UI policy by creating a UI policy action. See below screen shot for an example.



find_real_file.png


Kalaiarasan Pus
Giga Sage

whichever policy is existing and making the sections visible/hidden, use the same to make fields mandatory


Jake Gillespie
Mega Guru

I would avoid marking the fields as mandatory on the dictionary record, since this would be a permanent and global setting. The best practice recommendation is to use UI Policies, as mentioned above by Darius Koohmarey, Sean McGuire & Kalaiarasan P.



Using the existing UI Policy would be optimal, since the conditions that trigger the section are also required to make these fields mandatory. However, if additional conditions apply to the fields being marked mandatory or not, additional UI Policies would be required.



Client scripts can also be used, however UI Policies are the best practice recommendation provided the conditions can be triggered using them.



Regards,


Jake