Background color for caller field is not setting on form view

prajaktanaik
Giga Expert

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.

find_real_file.png

find_real_file.png

find_real_file.png

Can anyone help why is it not showing on form view?

Thanks in advance.

Prajakta

1 ACCEPTED SOLUTION

Alikutty A
Tera Sage

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.

 

 

View solution in original post

6 REPLIES 6

Mark Roethof
Tera Patron
Tera Patron

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:

find_real_file.png

find_real_file.png

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Hi Mark,

It looks like below:

find_real_file.png

Alikutty A
Tera Sage

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.

 

 

Paul Curwen
Giga Sage

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";

)

***If Correct/Helpful please take time mark as Correct/Helpful. It is much appreciated.***

Regards

Paul