UI Policy & field color
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2015 07:33 AM
So, this is an issue I'm facing at the moment:
I like the condition formatter of UI Policy, but instead of making a field mandatory or read only, I just want to set a background color for those fields.
Would this be possible in an easy way?
Desired result:
Both background colors: orange
- Labels:
-
User Interface (UI)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2015 08:23 AM
You can use a script in your UI policy to set the background color. The example below would work for the Incident table to set the Caller ID background color to Orange via UI policy. Just set it in your Execute if True script.
var callerField = $('sys_display.incident.caller_id');
callerField.setStyle({backgroundColor : "orange"});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2015 08:48 AM
David O'Brien (Cloud Sherpas) schreef:
You can use a script in your UI policy to set the background color. The example below would work for the Incident table to set the Caller ID background color to Orange via UI policy. Just set it in your Execute if True script.
- var callerField = $('sys_display.incident.caller_id');
- callerField.setStyle({backgroundColor : "orange"});
var callerField = $('sys_display.incident.caller_id'); callerField.setStyle({backgroundColor : "orange"});
Thanks David.
I got it working when using an alert.
Color is still not working unfortunately.
Getting this error:
onChange script error: TypeError: $ is not a function function (){var o=i(m,arguments);return l.apply(n,o)}
My script:
function onCondition() {
var commField = $('sys_display.x_medt2_ihs_it_support_request.team');
commField.setStyle({backgroundColor : "orange"});
alert("The communication template does not match with the assigned group!");
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2015 08:52 AM
You're running this on table x_medt2_ihs_it_support_request, correct? That looks to be a custom table. Does the table name actually have a u_ before it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2015 08:55 AM
x_ indicates a scoped app. No u_ necessary.