UI Policy & field color

rickw1
Giga Contributor

So, this is an issue I'm facing at the moment:

I like the condition formatter of UI Policy, but instead of making a field mandatory or read only, I just want to set a background color for those fields.

Would this be possible in an easy way?

2015-08-28_16-28-53.png

Desired result:

Both background colors: orange

12 REPLIES 12

Uncle Rob
Kilo Patron

I'm not sure if you can alter style from UI Policy.   If so,   it would be done in the "Execute if True" script if you have Run Scripts checked.



More than likely though, you'll need to Field Styles.   I like Field Styles better because they can work on both form and list view.


It is recommended to use field styles over DOM manipulation, which is more of a last restort type of mechanism when there is no other way.



ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

The SN Nerd
Giga Sage
Giga Sage

Why not use Field Styles?


Look at the OOB example:



find_real_file.png


In your case:


Field name: Requested for


Value: Your condition


fontColor : "red"



ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022