How to hide fields based on any roles?

Amit32
Giga Contributor

How can I hide fields based on role? 

For example, I have a support team for which I don't want to show all the fields but managers can able to see all the fields. please help me out

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Hi Amit,

Best to use read ACL to hide those fields based on role.

View solution in original post

10 REPLIES 10

Saurabh Gaikwad
Mega Expert

Hello Amit,

try this code, Using this code manager can see all field but other users are not see this field.

function onLoad() {

if(g_user.hasRole("Mention the Manager role")) // Provide the role
{

g_form.setVisible("Field name",true);

}
else
{
g_form.setVisible("Field name",flase); //
}

}

 

I hope this will help you.

Mark Correct if this solves your issue and also mark ???? Helpful if applicable.

Regards,

Saurabh,