- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2015 07:24 AM
The picture below shows what I've done to get a field highlighted based on the fields value
I have a feeling that I may have got the syntax wrong as this field is a string and not an integer/choice field.
I would welcome any feedback.
TIA
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2015 07:58 AM
Angus,
Use the below code:
function onChange(control, oldValue, newValue, isLoading) {
var cTypeLabel = $('label.incident.contact_type');
var cTypeField = $('incident.contact_type');
if (newValue == 'Self Service') {
cTypeLabel.setStyle({backgroundColor: "red"});
cTypeField.setStyle({color: "red"});
}
else {
cTypeLabel.setStyle({backgroundColor: ""});
cTypeField.setStyle({color: ""});
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2015 08:19 AM
I see in your older screenshot your value for "Self Service" is "self service".
so replace if (newValue == 'Self Service') with if (newValue == 'self service')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2015 08:19 AM
I'm testing on Fuji. Will try in live as I can remove if necessary
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2015 08:27 AM
Hi Angus,
The following client script worked for me in Fuji (in the personal developer instance):
var callerField = gel('sys_display.incident.caller_id'); |
callerField.setStyle("background-color:blue");
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2015 08:39 AM
I have tested in Fuji. My script worked fine in IE without any issues. In chrome the field value color is changed correctly but the label background color did not change.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2015 08:17 AM
Here is an example I have used in the past:
var dueDateLabel = $('label.incident.due_date');
dueDateLabel.setStyle("background-color:tomato");