How to move the VIP Icon inside the caller field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2023 03:32 AM
Hi All,
I would like to display the VIP Icon inside the caller field. I was able to update this in sys_user table using the styles however this is not working in Incident form.
I would like the VIP image to show up as below
Below is the field style :
below is the client script. If I try the bgposition greater than 100% it gets hidden
function onChange(control, oldValue, newValue, isLoading) {
var callerLabel = $('label.incident.caller_id');
var callerField = $('sys_display.incident.caller_id');
if (!callerLabel || !callerField)
return;
if (!newValue) {
callerLabel.setStyle({backgroundImage: ""});
callerField.setStyle({color: ""});
return;
}
g_form.getReference('caller_id', vipCallerCallback);
}
function vipCallerCallback(caller) {
var callerLabel = $('label.incident.caller_id').down('label');
var callerField = $('sys_display.incident.caller_id');
if (!callerLabel || !callerField)
return;
//check for VIP status
if (caller.u_vip == "vip") {
var bgPosition = "100% 100%";
if (document.documentElement.getAttribute('data-doctype') == 'true')
bgPosition = "100% 100%";
callerLabel.setStyle({backgroundImage: "url('6.png')", backgroundRepeat: "no-repeat", backgroundPosition: bgPosition, paddingright: '20px' });
callerField.setStyle({color: "red"});
} else {
callerLabel.setStyle({backgroundImage: ""});
callerField.setStyle({color: ""});
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2023 05:29 AM
Hi,
Create a Client Script and Upload the required icon image to System UI -> Images
Write down below code under script.
if (caller.vip == ‘true’) {
callerLabel.setStyle({backgroundImage: “url(images/icons/vip.gif)”, backgroundRepeat: “no-repeat”, backgroundPosition: bgPosition, paddingLeft: ‘30px’ });
}
Hit thumbs up if you feel that it was helpful in resolving your query.