
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2018 11:27 AM
When I right click on a field on a form and "configure styles"...the setting of background-color:#d9e5ff; This does nothing to the form field itself....it does show and work on the list of forms. How can I get the background of the form field to display a color? Is there something special about it?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2018 11:51 AM
Field styles only apply in lists. You can do this to a field on a form with a client script though. Here is the syntax you would need in your function...
var myField = 'state';
var ctrl = g_form.getControl(myField);
ctrl.style.fontWeight = 'bold';
ctrl.style.backgroundColor = 'lightBlue';
If you're dealing with a reference field you'll need to do it like this...
var myField = 'assignment_group';
var ctrl = $('sys_display.' + g_form.getControl(myField).id);
ctrl.style.fontWeight = 'bold';
ctrl.style.backgroundColor = 'lightBlue';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2019 11:17 AM
Field style works only on list view, not on form view.
SOLUTION - Instead of writing a client script, make the target field "Read only", Field style will work then and field should have some data contained in it. E.g. Incident number field which is coming automatically on form load, etc.
It works.
Regards,
Shubham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2019 08:42 PM
Unfortunately, I can't make the target field (Account) read only. There's no other way to fill the field with a color?
Mike

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2019 04:06 AM
Did you try an OnChange client script for CPM Account...when the value is true, try writing something like Mark Stranger identified for a reference field:
If you're dealing with a reference field you'll need to do it like this...
Change the myField to be the field name for Account and see if something like that works when you click the box of CPM Account. I remember that I was able to get this to work where I needed to.
var myField = 'assignment_group';
var ctrl = $('sys_display.' + g_form.getControl(myField).id);
ctrl.style.fontWeight = 'bold';
ctrl.style.backgroundColor = 'lightBlue';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2019 04:45 PM
When I attempt to create a Client Script (onChange) on the Case form/table, I don't see the CPM Account field. The CPM Account field is actually on the Account table. The CPM Account and Assigned CPM fields were created on the Account form/table. Then, I created a UI Policy on the Case table to show these 2 fields on the Case form if CPM Account was TRUE. These 2 fields were added to the Case form via Configure Layout (Account.CPM Account & Account.Assigned CPM).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2020 08:09 PM
Hi Trena,
I got the field color to work using the code you mention. How can I configure the code to use an icon instead of a background color? How would I change:
ctrl.style.backgroundColor = 'lightBlue';
to use an icon?
images/icons/flag_red.gif