- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2020 08:22 AM
I'm trying to change the font color of the due dates in the list view of PTASKS if the due date is past, but no matter what I try it doesn't seem to work.
Here's what I have now:
Table: Problem Task [problem_task]
Field Name: Due date
Value: javascript:gs.dateDiff(current.due_date.getDisplayValue(),gs.nowDateTime(),true) < 0 ;
Style: color:red;
What am I doing wrong?
Also, where can if find a comprehensive list of styles (colors, background, font sizes, etc.) ?
Solved! Go to Solution.
- Labels:
-
Problem Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2020 12:43 PM
If its exceeding the field limits then you can put the code in script include and from there return true/false.
Like for yellow you could do this.
1) Create a script include (I named mine as TestDate)
2) Then call the script include (and function - which I named isYellow) from Styles
Could you please mark my answer as correct? It gives me few points on community.
Thank you!
-Tanaji
Please mark reply correct/helpful if applicable

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2020 12:48 PM
Open is the label and not backed value. Put backed value in value field (should be number value) and try.
-Tanaji
Please mark response correct/helpful if applicable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2020 01:13 PM
Ah - Very good! This is now the behavior I'm looking for.
When I set the state value to '1' instead of 'open', the state field shows up red in the list view now and not the form view.
However, this just solved my experiment only.
I'm still looking for an answer to my original question which is why my javascript for determining if a PTASK is overdue isn't working.
I've tried 3 different things:
javascript:gs.dateDiff(current.due_date.getDisplayValue(),gs.nowDateTime(),true) < 0 ;
javascript: var answer = gs.dateDiff(current.due_date.getDisplayValue(),gs.nowDateTime(),true) < 0; answer;
javascript: var answer = (current.due_date.getDisplayValue() <= (new GlideDateTime().getDisplayValueInternal())); answer;
None of these work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2020 02:00 PM
So right now this is working on the list view if I'm actually in the Problem ticket itself.
(See 2nd screenshot)
Table: Problem Task
Field Name: Due Date
Value:javascript: var answer = (current.due_date.getDisplayValue() <= (new GlideDateTime().getDisplayValueInternal())); answer;
Style: background-color: red
However, I'd like this format to show up when I'm in the "Tasks" List view as well.
(1st Screenshot)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2020 05:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2020 05:48 AM
Where do I include this? In the Value window? Like this?
javascript: var answer = (current.due_date.getDisplayValue() <= (new GlideDateTime().getDisplayValueInternal())); answer; current.sys_class_name == 'problem_task';