- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 08:34 PM
Hi All,
I have a requirement where I need to show the records in a custom view on the portal if a logged-in user has a particular role.
I have created a custom view and view rule for users who will have that role but that doesn't work.
On the portal, I'm fetching the data via a page. When a specific user opens any record he should see in that custom view, but it's not working as expected.
Please help me to understand where I'm missing.
Thanks in advance,
Amol
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 10:04 PM
Hi,
gs.hasRoleExactly is wrong. hasRoleExactly is not the method of glidesystem api. Please use hasRole method.
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 10:40 PM
Hi @Amol Pawar ,
Please refer the below code.
if(gs.hasRole('role name')){
answer = 'view name' ;
}
Mark my answer correct and helpful if helps you.
Thanks,
Nivedita Patil.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 10:04 PM
Hi,
gs.hasRoleExactly is wrong. hasRoleExactly is not the method of glidesystem api. Please use hasRole method.
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 05:12 AM
Thank you very much @Saurabh Gupta for your reply.
You are correct! "gs.hasRole()" is correct and working fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 10:40 PM
Hi @Amol Pawar ,
Please refer the below code.
if(gs.hasRole('role name')){
answer = 'view name' ;
}
Mark my answer correct and helpful if helps you.
Thanks,
Nivedita Patil.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2023 05:08 AM