- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2019 09:41 AM
Hi there,
Does anyone know how to hide a section in a form based on their role?
I am trying to hide the section "Service_Incident" to all users, only visible to users with the role " LegalServices_Manager"
I have tried the client script below without joy. Any help most welcome.
if(g_user.hasRole('legalservice_manager'))
{
g_form.setSectionDispaly('Service_Incident',true);
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2019 09:49 AM
That should work, you do have a typo though. Try:
if (g_user.hasRole('legalservice_manager')){
g_form.setSectionDisplay('Service_Incident', true);
} else {
g_form.setSectionDisplay('Service_Incident', false);
}
Please mark this as correct/helpful if it resolved your issue!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2019 09:49 AM
That should work, you do have a typo though. Try:
if (g_user.hasRole('legalservice_manager')){
g_form.setSectionDisplay('Service_Incident', true);
} else {
g_form.setSectionDisplay('Service_Incident', false);
}
Please mark this as correct/helpful if it resolved your issue!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2019 10:09 AM
Try below code:
}
IMPORTANT NOTE :
Refer this :
Show/Hide Form Section by Name
Please mark as Correct Answer and Helpful, if applicable.
Thanks!
Abhishek Gardade
Hexaware Technologies
Abhishek Gardade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2019 02:39 AM
Both very helpful, thank you very much.