Highlight VIP Users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2007 06:46 PM
A customer recently asked for a better way to quickly identify VIP users from the incident form without having to add the VIP field to the form. She wanted to somehow apply a style to the caller label or field. I couldn't figure out how to use 'Personalize Styles' based on other field values so I used a client script. Since onChange events are fired onLoad this works when opening an existing incident as well.
There's an example of modifying the label and value styles.
New incident client script, onChange of caller.
Great idea, thanks Amie.
function onChange(control, oldValue, newValue, isLoading) {
//wait until there is a valid record in the field
if (newValue) {
//get the caller object so we can access fields
var caller = g_form.getReference('caller_id');
//check for VIP status
if (caller.vip=='true') {
//change the caller label to red background
//style object is CSSStyleDeclaration so style names are not standard css names
document.getElementById('label.incident.caller_id').style.backgroundColor='red';
//change the caller's name field to red text
document.getElementById('sys_display.incident.caller_id').style.color='red';
}
else {
//not a VIP, remove temporary styles
document.getElementById('label.incident.caller_id').style.backgroundColor='';
document.getElementById('sys_display.incident.caller_id').style.color='';
}
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2012 03:32 AM
Hi,
I am also interested in doing this, do you know if there is anyway of having the logo still in the script as well as thee background colour?
Thanks
Dan