Configuring Styles for a Particular Field

preethiraokn
Kilo Explorer

Hi ,

Requirement is need to configure Styles for   Status Indicator field based on condition.

The condition is ,If current date < Expected closure date , the field by the name status indicator should be green

We defined   by writing the value but it is not wokring

Script was   javascript:gs.nowDateTime()<current.u_glide_date_time_60

find_real_file.png

Regards
Preethi

14 REPLIES 14

Midhun1
Giga Guru

Hi Preethi,



Just wanted to confirm : What is the field type of Status indicator..


Please check Defining Field Styles - ServiceNow Wiki


preethiraokn
Kilo Explorer

Hi Midhun,



The field type of Status Indicator is String



Regards
Preethi


Hi Preethi,



have you checked my last response ? let me know if it did not help you.


Hi Harsh,


As suggested updated all the details but did not work in list view nor form:-(


Thanks and regards
Preethi


Hi Preethi,



If you want to just highlight use Flash method of g_form GlideForm class. It will blink for 2 to 3 seconds in the form layout.



For list layout I used the same field (date field which we need to validate). It works fine for me.



value: javascript:var answer= gs.dateDiff(gs.now(), current.u_end_date.getDisplayValue(), true) < 0; answer;


Enddate.png



Enjoy:)