Issue on Field Style

amlanpal
Kilo Sage

Hi All,

I'm facing a typical issue on Field Style. Hope you can provide solution to this. Here is the issue:

I have applied same field style to both Caller field and Assigned to field on Incident form to display the VIP icon beside the field if the selected user is VIP. The Field Style applied on Caller field is an OOB one. Just created the same Field style for Assigned to field and modified the Field name & Value to Assigned to in order to apply the same style on the field.

Surprisingly, the Assigned to Field Style is not working on form view. Whereas, I can see the style applied to both the fields on List view. Please see the screenshots below.

The Field style for Assigned to field is given below. The only relevant changes are there for Caller field Field style is there and working fine:

Table: Incident

Field name: Assigned to

Value: javascript:current.assigned_to.vip == true;

Style:background-image: url('images/icons/vip.gif');

background-repeat: no-repeat;

background-position: 98% 5px;

padding-right: 30px;

Any help will be highly appreciated!

find_real_file.png

find_real_file.png

1 ACCEPTED SOLUTION

Kalaiarasan Pus
Giga Sage

Field style doesn't work usually on form layout if the value of field style contains 'javascript:' (Dynamic condition). If you can hard code some condition, it might work well.


View solution in original post

12 REPLIES 12

Kalaiarasan Pus
Giga Sage

Field style doesn't work usually on form layout if the value of field style contains 'javascript:' (Dynamic condition). If you can hard code some condition, it might work well.


Thanks Kalai!


Chuck Tomasi
Tera Patron

Kalai is correct. Field styles apply to list views, not form views. To modify the form styles requires a client script. Use this one as an example (substituting your instance name for YOURINSTANCE.)



https://YOURINSTANCE.service-now.com/nav_to.do?uri=sys_script_client.do?sys_id=8f0b3ee00a0a0b5700e75...


If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.



If you are viewing this from the community inbox you will not see the correct answer button.   If so, please review How to Mark Answers Correct From Inbox View.



Thank you


Thanks Chuck