- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2022 03:10 AM
hi everyone,
Add the style to number field
if records are created today those records are visible in green color.
if records created in yesterday and day before yesterday that records shown as blue color.
and remaining records are shown in red color.
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2022 09:34 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2022 03:21 AM
Hi Venu,
you have to create 3 field styles as below in value you can add code as per requirement.
-
Log in to a demo instance.
-
Navigate to System UI > Field Styles and click New.
-
Create two new styles with the following values, and click Submit after creating each one.
Style 1:
Table: incident
Field name: number
Value: javascript:true
Style: background-color:red
Reference Article : Field styles
Kindly mark correct and helpful if applicable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2022 03:21 AM
Hi,
create 2 field styles 1 for every color
Green
javascript: new GlideDateTime(current.sys_created_on).getDate() == new GlideDateTime().getDate()
Blue
javascript: new GlideDateTime(current.sys_created_on).getNumericValue() < new GlideDateTime().getNumericValue()
Red - you won't have records created in future -> So this is not required
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2022 09:34 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2022 04:20 AM
We can use g_form.flash also