- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
07-13-2021 01:17 AM
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
Solved! Go to Solution.
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
07-13-2021 01:35 AM
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
07-13-2021 01:43 AM
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,
