VIP indicator on Catalog Task

Nitin_NOW
Tera Guru

Hello Everyone

I'm trying to work to show the VIP indicator for 'Requested for' field on CTASK form. For this I chose to create a Field style with the value and style in it. Below is how I configured it, but somehow this doesn't work.

find_real_file.png

'u_task_for' is the field value for 'Requested For' on the CTASK table. When I configured the form layout, it says the field is 'Request.Requested For', so I used the same in the value field i.e. 'sc_request.u_task_for'. Not sure if this is the way. But just   trying to get some suggestions to move forward.

Thanks in Advance.

Regards!

9 REPLIES 9

Dear Nitin,



Thanks,



Would you like to share the script that is showing the requested for text in red color on sc_request record, I can take a look and share my inputs.


Sure, please find it below.



function onChange(control, oldValue, newValue, isLoading, isTemplate) {


 


var callerLabel = $('label.sc_request.requested_for');


var callerField = $('sys_display.sc_request.requested_for');


if (!callerLabel || !callerField)


return;



if (!newValue) {


callerLabel.setStyle({backgroundImage: ""});


callerField.setStyle({color: ""});


return;


}


g_form.getReference('requested_for', vipCallerCallback);


}




function vipCallerCallback(caller) {


var callerLabel = $('label.sc_request.requested_for').down('label');


var callerField = $('sys_display.sc_request.requested_for');


if (!callerLabel || !callerField)


return;



//check for VIP status


if (caller.vip == 'true') {


var bgPosition = "95% 55%";


if (document.documentElement.getAttribute('data-doctype') == 'true')


bgPosition = "5% 45%";



callerLabel.setStyle({backgroundImage: "url(vip_user.png)", backgroundRepeat: "no-repeat", backgroundPosition: bgPosition, paddingLeft: '30px' });


callerField.setStyle({color: "red"});


} else {


callerLabel.setStyle({backgroundImage: ""});


callerField.setStyle({color: ""});


}


   


 


}



Regards!


Thanks Nitin.



When I tried to run just the core script (w/o the callback function all of that ) It worked for me in RITM



I made this onload script



function onLoad() {


    //Type appropriate comment here, and begin script below


    $('label.sc_req_item.request.requested_for').down('label').setStyle({backgroundImage: "url(images/icons/vip2.gif)", backgroundRepeat: "no-repeat", backgroundPosition: "5% 45%", paddingLeft: '30px' });


    $('sys_display.sc_req_item.request.requested_for').setStyle({color: "red"});


}



It showed both the icon and changed the color to red. But the difference being in your case the field is read only and mine its read write, I see that the 'Requested For' is read only on sc_task table



find_real_file.png



So, If you do a inspect element on the requested for field you will see that the label has sys_readonly.sys_display_sc_task.request.requested_for. This is what is causing the name to not apply the red color. I tried but I dont know how to work around it..


find_real_file.png


Miara22
Tera Contributor

Hi I am looking for the same like VIP show message for Requested_For on sc_task table but not working...on sc_task the Field Request.RequestedFor in list

layout. Any suggestion

Community Alums
Not applicable

Hi,

 

Please take a look OOTB Client script to show the VIP symbol on incident form and create the Similar script for your request table.

 

It will work i believe because few months back , i had tried it, it was working and showed the VIP symbol near the requested for field.

 

OOTB client script name - Highlight VIP Caller

Thanks,

Vikas