- 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-15-2015 08:56 AM
Create a onChange client script on Contact type to change the background color of the value when "Site Surgery" is selected.
You can modify "Highlight VIP" client script on Incident.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2015 04:01 AM
Thanks to all for yesterday's input.
The field I need to change the style of is on a form so I have been playing with a Client Script but it's not working. I'm sure it's my code that's wrong but not being a coder I can't work out the correct syntax. Also I identified I couldn't dot walk in a Client Script and as the original field is on the task table I've tried to take that into account. Here is what I have got so far:-
function onChange(control, oldValue, newValue, isLoading) {
//wait until there is a valid record in the field
if (newValue) {
var type = g_form.getReference('task.contact_type');
if (type = "Self Service")
//change the contact type label to red background
document.getElementById('label.task.contact_type').style.backgroundColor='red';
document.getElementById('sys_display.taskcontact_type').style.color='red';
}
}
Thanks
- 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:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2015 08:15 AM
Eventhough 'Contact Type' is inherited from Task table, it is available for Incident table which extends task table. In Table change it to Incident.
Are you on Eureka or Fuji? I tested in Eureka and it works fine.