How to show VIP flag for Scoped Application related Caller field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2024 05:18 AM
Hi Team,
I'm working on Procurement module and working on Procurement Case Management Application. We have some VIP users, those need to show VIP flag. I've tried by using Incident VIP script. But, it is not working. Is there any way to show VIP flag for VIP users in scoped applications.
Please see the Onload Client script for showing VIP flag.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2024 02:02 AM
You can create a display business rule to check the VIP users
And then use the g_scratchpad variable in the client script to do further actions.
Please mark helpful if you accept the solution.
Thanks
Sanjana
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2024 04:13 AM
Hello @prasannakumard ,
Update your script to refer below code and make adjustment in it as per your requirement:
function onLoad() {
var callerLabel = g_form.getLabelOf('u_caller');
var callerField = g_form.getControl('u_caller');
if (!callerLabel || !callerField) return;
g_form.getReference('u_caller', vipCallerCallbackREQ);
}
function vipCallerCallbackREQ(caller) {
var callerLabel = g_form.getLabelOf('u_caller');
var callerField = g_form.getControl('u_caller');
if (!callerLabel || !callerField) return;
// Check for VIP status
if (caller.vip == 'true') {
callerLabel.style.backgroundImage = "url('images/icons/vip.gif')";
callerLabel.style.backgroundRepeat = "no-repeat";
callerLabel.style.backgroundPosition = "95% 55%";
callerLabel.style.paddingLeft = '30px';
callerField.style.color = "red";
} else {
callerLabel.style.backgroundImage = "";
callerField.style.color = "";
}
}
Thank you!!
Dnyaneshwaree Satpute
Tera Guru

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2024 05:58 AM
@Dnyaneshwaree The above script is not working for me on form level.
For form level, I've used the below script:
function onLoad() {
//Type appropriate comment here, and begin script below
var userGA = new GlideAjax("x_dhmog_human_ca_0.HumanCaptialVIPUtils");
userGA.addParam("sysparm_name", "isVipOf");
userGA.addParam("sysparm_vip", g_form.getValue('u_dh_hr_case_table_caller'));
userGA.getXMLAnswer(checkingVip);
function checkingVip(answer) {
if (answer == 'true') {
g_form.showFieldMsg('u_dh_hr_case_table_caller', 'This is a VIP Caller', 'error');
g_form.addDecoration('u_dh_hr_case_table_caller', 'icon-star', 'VIP');
}
}
}
For native List layout level I used styles.
Thank you for your help.
Thanks & Regards,
Prasanna Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2024 06:04 AM