Notifications
Announcements
No record found.
How to get all Security roles of User based on Userid in Javascript
*This post is locked for comments
Hi Akash,
In order to retrieve the security roles in JScript you have to make a SOAP request.
In the next link you may find how to perform a SOAP request for a Retrieve Multiple. In your case, you only have to replace the query fetchXml in the request, by the fetchXml to get all secutity roles that a user is part of.
mileyja.blogspot.pt/.../use-fetchxml-queries-in-jscript-and-net.html
Additionally If you wish to get the Role Ids of Current Logged in user, you can get it using Xrm.Page.context.getUserRoles().
Just curious - isn't it possible to use OData instead? I believe it's possible and much more easier - community.dynamics.com/.../204295
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2