Restrict switching views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2024 11:40 PM
Hi Team,
For Non-HR agents, when they search HR case it must land on self service view and that's working fine as per view rule.
But i want to restrict them from switching to other listed views.
i.e, when they try to switch My HR work or any other views it should again revert to self service. Other wise I must remove all the view for them expect self service
Kindly suggest.
Thank You.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2024 11:55 PM
Hi Preet,
On load Client script can be written on hr case table ,
if (!g_user.hasRole(//role which u need to check)) {
var currView = g_form.getViewName();
if (currView !== 'self_service') {
g_form.setView('self_service');
}}
Hope this would help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2024 11:59 PM
Hi @Nasreenfathima , The view is getting set rightly to self service, issue is that i have to remove others views from being visible or restrict switching to other views from self service.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2024 12:17 AM
Read ACL can be created on HR Case table, with a condition to check if the user is not an HR role.
if (!gs.hasRole(hr role) && current.view !== 'self_service') {
answer = false;
} else {
answer = true;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2024 12:29 AM
You can remove the role 'view_changer' from their user records.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark