- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2019 07:31 AM
Hello All,
I am trying to set background color as orange for caller_id field on incident table as below using the field style for VIP caller, but it is not showing on the form view. However, in list view it does show the orange color. Please refer below screenshot and attachments.
Can anyone help why is it not showing on form view?
Thanks in advance.
Prajakta
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2019 08:21 AM
Hi,
We do not use Styles for the form view background color.
You will need to modify the OOB client script named "Highlight VIP Caller" and apply your CSS in it.
Add the following script
callerLabel.setStyle({backgroundImage: "url(images/icons/vip.gif)", backgroundRepeat: "no-repeat", backgroundPosition: bgPosition, paddingLeft: '30px' });
callerField.setStyle({color: "red"});
callerField.setStyle({backgroundColor: "orange"});
Here is the URL: https://instance_name.service-now.com/nav_to.do?uri=sys_script_client.do?sys_id=8f0b3ee00a0a0b5700e75f4aaabe4953
Replace instance_name with yours.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2019 07:37 AM
Hi there,
Can you share how your field style looks like? To quickly find the style, right click on the field label and select "Configure Styles".
For example, the below works:
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2019 08:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2019 08:21 AM
Hi,
We do not use Styles for the form view background color.
You will need to modify the OOB client script named "Highlight VIP Caller" and apply your CSS in it.
Add the following script
callerLabel.setStyle({backgroundImage: "url(images/icons/vip.gif)", backgroundRepeat: "no-repeat", backgroundPosition: bgPosition, paddingLeft: '30px' });
callerField.setStyle({color: "red"});
callerField.setStyle({backgroundColor: "orange"});
Here is the URL: https://instance_name.service-now.com/nav_to.do?uri=sys_script_client.do?sys_id=8f0b3ee00a0a0b5700e75f4aaabe4953
Replace instance_name with yours.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2019 08:28 AM
Try this in an onLoad Client Script:
if (g_form.getValue(caller_id) == true) {
g_form.getElement("sys_display.incident.caller_id").style.backgroundColor="orange";
)
Regards
Paul