change color on due date field when approaching due date and expired

Nic Omaha
Tera Guru

Sorry I know this is probably a simple question but how do I get the Due Date field on Request, and Item in Service Catalog to turn yellow if its say 2 days before due date and red if its on or past the due date?

 

req due date field.JPG

item due date field.JPG

13 REPLIES 13

Hi Travis, I am looking for a way that i can make the a column flash in the list view...i saw a wiki article but that only in a form. any thoughts on this?



g_form.flash("incident.number", "#FFFACD", 0);




Hi Matthew,



I can think of some hacky ways of doing it using DOM Manipulation but nothing I would necessarily recommend.   If you are truly interested, I can help you dig into it further.   Definitely see if there are some alternative ways of addressing the requirement before you go down that road though.   DOM manipulation is not supported at all and in fact is aggressively being removed as a capability by ServiceNow.


Hi Travis, thank you for the reply..I think its better to keep away from any of those changes



i actually ended up in this discussion because of this link


http://www.servicenowguru.com/scripting/client-scripts-scripting/removing-form-buttons/


I think this solution also involved some DOM manipulations..can you share a sample script in which a UI action visibility can be controlled via a client script, if possible? my use case is to only show   a UI action(action name is test_ui) when priority is set to 1



regards



Matt


Hi Matthew,



Once again, the only way that I am aware of is via DOM manipulation as you saw on the SNG site.   The easiest approach under UI15/UI16 is to put a value in the UI Action's Action name field.   That action name is currently given to the button's id, so you can hide it easily using a script like so:



$('your_action_name_here').hide();



Edit: Oh and of course if you only need to check the condition to show / hide when the form loads, you can always just use the UI Action's Condition field.   But I was assuming you already knew that.


Hi Travis, i am using createnow and i think they already not available in a scoped application



Thank you