Field Styles in list views but not on forms
Import
·
Jun 05, 2019
·
article
There are times where you want a field style to appear in a list view (such as with a red dot beside a value), but not on the actual form when it opens (because it would look like a web site from the 90s).
In this example, the short description will have a red dot beside it when viewed in a list, but when the form opens it will appear normally (without the entire field being turned fire engine red)
To do this, you need to add a function to identify which page is currently in use...
Simply replace add this function after your regular field style.
javascript:current.urgency==1 && (function(){var thisURI = gs.action.getGlideURI().toString(); return thisURI.indexOf('_list.do')!=-1})()
View original source
https://www.servicenow.com/community/now-platform-articles/field-styles-in-list-views-but-not-on-forms/ta-p/2326187