The CreatorCon Call for Content is officially open! Get started here.

Field styles for the field

amaradiswamy
Kilo Sage

Hi All,

We have "Requested_for" field in "Request(sc_request) table. In requested item table instead of creating a new field we have used this field by using the dot walking functionality(request.requested_for), same for the catalog tasks.

Now we have requirement like defining field style for the VIP users in "catalog Tasks" list. We have defined the style for "requested_for" for request table and it works great. But, for requested item and catalog tasks the field styles are not working because the field(requested_for) is not available in these table.

Is there any way to define styles(highlighting) for VIP users in the list of request item and catalog task records?

Thanks in advance

Thanks & Regards,

Swamy

1 ACCEPTED SOLUTION

Oh, I see, my apologies for misunderstanding.



You can make styling work with dot-walked fields by customizing the style in the following way:


hero3.png


I've added sc_task.request.requested_for to the list and the styling works:


hero2.png


View solution in original post

14 REPLIES 14

Paul Morris wrote:



OP is using "request.requested_for"


Yes, that was exactly what I've provided the solution for.


Style is customized for request.requested_for and when added to the sc_task list the styling works.


Oh wait I see what you have done.


That is quite a nice little workaround, would not have thought that would work.



ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

Hi epam and morris,



It worked for me when i have used javascript:current.requested_for.vip == true || current.request.requested_for.vip == true in the value field.



Thanks you(epam and morris) so much.



Regards,


Swamy


PerV
Kilo Sage

Since this post is quite old it didn't work for me on Vancouver. However, another method do work nowadays.

PerV_0-1715151774812.png

 

Value (condition):

javascript: (current.isValidField('requested_for')) ? current.requested_for.active != true : current.request_item.requested_for.active != true

 

This is set on RITM level, and trickles down to SCTASK level since the requested for field does not exist on SCTASK.

 

Our purpose was to highlight inactive users, and results in this:

PerV_2-1715152094880.png

 

Style: 

background-image: url('images/error.gif');
background-repeat: no-repeat;
background-position: 98% 5px;
padding-right: 30px;
font-style: italic;

Unfortunately it was not a complete solution. It breaks on related lists like approval records. I need to find a solution for that as well. I am NOT inactive 🙂

PerV_0-1715324525691.png

If anyone out there has a solution, I would much appreciate some assistance.

 

/Per