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

Shaikh Mzhar
Tera Guru

Hi Amit,

You can write Client script and below code(make changes as per your requirement).

 

function onLoad()

{

var role_check =   g_user.hasRole('Mention the Role Name');

if(role_check == true){

g_form.setDisplay('Field Name', true);

}

else if(role_check == false){

g_form.setDisplay('Field Name', false);


}

 

Please mark my answer Correct Or Helpful if applicable.

Thank you
Mzhar

is it possible without scripting..

because someone told you can do that from business rule, i tried but i unable to do..

is it possible through business rule, if yes then please provide answer

Hi Amit,

If you want to do with business rule then you can take condition as when to run - Display and in Advance put the same script.

You have to use the script, to hide/show fields.

 

Rather than use the Business-Rule the recommended way to hide/show fields is a Client-Script.

 

Please mark my answer Correct Or Helpful if applicable.

Thank you
Mzhar

Hello,

Business rule is a server side script and it can't hide the fields....

 

Thanks

Thanks,
Murthy