Apply multiple field styles

amala2
Mega Guru

I am trying to apply two field styles on the incident Number field.Below are the 2 field styles:

1.If state is In Progress , field style used is "text-align:right"

2.If Priority is P1 , field style used is "background-image: url('myIcon.gif');"

So when an Incident State is In Progress & Priority is P1 ,only the "text-align:right" is getting applied.But I want both the styles to get applied.

Kindly help.

1 ACCEPTED SOLUTION

Try this


Create a third style merging those 2 conditions



Condition: javascript: current.state =='3' &&   current.priority =='1'



Value :


background-image: url('myIcon.gif');


padding-right: 30px;


background-position: 98% 6px;


background-repeat: no-repeat;


text-align:right


View solution in original post

8 REPLIES 8

Hi Amala,



Yes, it works. current works in field styles. You can query few out of box field styles where script includes are used. Navigate to System UI-> Field Styles and search by Value contains 'new'



find_real_file.png



Please mark this response as correct or helpful if it assisted you with your question.

Hi Amala,



Did creating the 3rd condition worked?


Yes, it worked


Hello Aakash

I've two conditions being applied on the Number field (one SLA which gives a green dot) and one more Escalate button (if true on incident form) an alarm icon 

as suggested created 3 styles (two individually) and one merged (both conditions) but when viewed in the list form for an incident where SLA is green and escalate button is tru only alrm icon is visible where as green dot is missing/overidden

Besides to this when I load that perticular incident the Incident cell isn't filled with green but alarm icon is alony mapped

I would also need the indication of two things (green fill representing SLA within timelines) alarm (esclated ticket) as a field Escalate is checked true on Incident form

Could you assist me on this!