Changing field color based on Null Variable

Walter Toney
Tera Expert

ok let me explain this better..

 

i have a Multi Line Text Field  "Field1"  and i am using that field to Turn the Color of the text and backgroud of another Date Field "Field2" if "Field1" is not NULL

 

I know i can do it with out code but our requirement is that we need "field1" not being null to turn it 

i have tried the following 

 

javascript:current.justification_for_urgent_request != "" ;

javascript:current.justification_for_urgent_request != '' ;

javascript:current.justification_for_urgent_request != null ;

javascript:current.justification_for_urgent_request != ;

 

but nothing seems to be working and i don't fully understand why... any thoughts

15 REPLIES 15

DrewW
Mega Sage

Its javascript:, you have a ".", change it to a ":".

Or do what @Deepankar Mathur mentioned.

Thank you .. I have updated my question if you could read and answer that would be awesome.. thanks again.

Walter Toney
Tera Expert

ok let me explain this better..

 

i have a Multi Line Text Field  "Field1"  and i am using that field to Turn the Color of the text and backgroud of another Date Field "Field2" if "Field1" is not NULL

 

I know i can do it with out code but we need that Driver of "field1" not being null to turn it

i have tried the following 

 

javascript:current.justification_for_urgent_request != "" ;

javascript:current.justification_for_urgent_request != '' ;

javascript:current.justification_for_urgent_request != null ;

javascript:current.justification_for_urgent_request != ;

 

but nothing seems to be working and i don't fully understand why... any thoughts

Ankur Bawiskar
Tera Patron

Hi,

the field style with value would work on list

how are you testing it?

this looks fine to me

javascript:current.justification_for_urgent_request != "" ;

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

once the script is in place i submit a request then open it and the color is not changing nor does it change if i open and existing request

 

if i keep everything but the script it works on new and existing requests so im trying to figure that out