How to add VIP icon before field "Requested for" on RITM form.

VIKAS MISHRA
Tera Contributor

We have one on load client scrfipt that shows the VIP icon before "caller" field if user is VIP but when we created the same script as on load on because field "requested for" is read only then this script not working and not showing icon, please suggest.

 

Below is my on load client script that we have writted on sc_req_item table.

function onLoad() {
   function vipCallerCallback(requested_for) {
    var callerLabel = $('label.sc_req_item.request.requested_for').down('label');
    var callerField = $('sys_display.sc_req_item.request.requested_for');
    if (!callerLabel || !callerField)
        return;

    //check for VIP status
    if (requested_for.vip == 'true') {
        var bgPosition = "95% 55%";
        if (document.documentElement.getAttribute('data-doctype') == 'true')
            bgPosition = "40% 100% ";

        callerLabel.setStyle({backgroundImage: "url(images/icons/vip.gif)", backgroundRepeat: "no-repeat", backgroundPosition: bgPosition,backgroundSize: '25px', paddingLeft: '30px',});
        callerField.setStyle({color: "red"});
    } else {
        callerLabel.setStyle({backgroundImage: ""});
        callerField.setStyle({color: ""});
    }

   }
}
3 REPLIES 3

POOJA SINGH18
Mega Guru

Hi @VIKAS MISHRA ,

 

The same functionality is available OOB on Incident table. You can utilize those scripts for your requirement.

 

Hope it helps and please mark helpful if it solves the issue.

Thanks,

Pooja Singh

Hi Pooja, thanks for revert.

 

Yes checked that script of incident table also but that is working fine for incident but not for ritm form when i using for ritm table, might possible the backend names of requested for field is wrong from my side

@VIKAS MISHRA , did you get this to work on the RITM?