Hide Unhide a particular field based on roles using client side scripting

I need to hide a field for a particular role & unhide for all other rows

@Varna

use
cur_frm.toggle_display("fieldname", false/true) to hide / unhide field

@Varna,

you can get the user roles in user_roles variable then you can check against the particular role and hide the field as per @Sangram suggession.

e.g.


if(inList(user_roles, “Employee”)) {
//hide field
}

Thanks, Makarand

Thanks @makarand_b & @Sangram a lot :).
Its working.
Sorry to trouble you but can i change the column width of the list view ?

@Varna

for column width check below thread