- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2025 10:14 PM
Hi all,
My requirement is to show color codes in server table based on nearing/expired EOS dates.
- Red color EOS within 3 month (less than or equal to 4 months)
- Amber color EOS within 6 month (Between 4 to 8 months)
- Green color EOS in 1 yrs 0r above. (More than 8 months)
I have created a script include but it isn't working. PFB -
Script include -
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2025 11:15 PM
Thanks all,
I was able to get this sorted using Field Styles scripting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2025 10:36 PM
it's the usual method how you do from any server side script
you are passing current but not using it.
you should use current.sys_id in query to check for the current record and then check for the months logic
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2025 10:46 PM
Hi @Ankur Bawiskar ,
Do you means she should change this line-
Regards,
Nikhil Bajaj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2025 10:48 PM
Hi @Dolly M ,
Unfortunately, Field Style scripts cannot directly invoke Script Include, they execute in a simplified context where GlideAjax or server-side calls aren’t supported. The field style syntax only allows inline expression logic and cannot call external server-side code. Instead, use a Client Script to call a client-callable Script Include via GlideAjax.
Try this once and let me know. If you find this helpful, please accept this as a solution and hit the helpful button..
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2025 11:15 PM
Thanks all,
I was able to get this sorted using Field Styles scripting.