How to disable/hide preview (i) icon on a reference field?

andresgt
Mega Expert

Hi Guys,

Is there a way to achieve this if a user doesnt have a certain role?

Let's say if user has ITIL then he can see the icon, if he doesn't have ITIL then he won't be able to see it.

This is kindof urgent, if anyone has any idea it would help.

find_real_file.png

Thanks

10 REPLIES 10

Michael Fry1
Kilo Patron

If the field is read-only, without readonly_clickthrough=true, it won't show the reference icon.

Is that through attribute or through code?


Also is there a way to use it inside a condition?

Please try with onload client script to check if user has required roles to hide the hover icon, please refer the sample code and link for more info:

 

function onLoad() {

 

//Type appropriate comment here, and begin script below

 

if(g_user.hasRoles('itil'))

 

$('view.incident.caller_id').hide();  

 

}

 

Regards,

Sachin

Let's say if it's for RITM then if would be like this?

$('view.sc_req_item.request').hide();