How do I add a style for a list view only?

DrewW
Mega Sage
Mega Sage

I found this today and I like the idea
http://wiki.service-now.com/index.php?title=Indicating_Updated_Tickets

But my issue is I only want it to display on the list. Does anyone know of a way to detect what the user is viewing so I can add to the condition?

12 REPLIES 12

Thank you for your quick reply! Do you call the functions incident_listGetViewName and incidentGetViewName somewhere because I do always get a null value for isListView? That's why I still get the Icon in both, List and Form because the condition is always true.


The system calls the function on its own, that's why the function names are important.   I do know that over the years we have had issues with what you are talking about but the current code above is working just fine.


Markus Schaefer
ServiceNow Employee
ServiceNow Employee

Might it be a topic of different ServiceNow Versions? Nevertheless, I managed to solve the topic now with a combination of the Business Rule and the View Name. This should be sufficient at the moment. Thanks a lot for your assistance!


Hi Markus,



I am trying to get a style work in list view but it works in both list and form. Can you share the script you have and changes you made to get it working. Is the script global if not is it running on display?



Regards,


SR


Markus Schaefer
ServiceNow Employee
ServiceNow Employee

Hi Shakti,



sorry for the late reply! I handled it with the System UI > Field Style only.


Here I entered the following line in the Value field of the Field Style:


javascript:current.u_update_flag == true && RP.getParameterValue('sysparm_view') != "ess"


u_update_flag is a custom field. For me it was necessary the Field Style is not used in the ess view, that's why I exclude it this way.



Best regards,


Markus