web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Regarding User Security Roles

(0) ShareShare
ReportReport
Posted on by 104

Hi, 

I am trying to fetch the user security roles GUIDs and Name but it is not working.

Xrm.Utility.getGlobalContext().userSettings.roles

I have use above mentioned function in JavaScript for Ribbon button, but not working, it return undefined for me.

Please help to resolve this issue.

Thanks!

I have the same question (0)
  • Suggested answer
    Abdul Wahab Profile Picture
    12,119 Moderator on at

    Hi Pradnya Wankhade ,

    Can you run the below lines:

    alert("Teting");

    let userSettings = Xrm.Utility.getGlobalContext().userSettings;

    alert(userSettings);

    Are you gettings alerts with some values?

  • Pradnya Wankhade Profile Picture
    104 on at

    Yes, I got alert for userSettings but if I add alert for userSettings.roles as given in Microsoft Document it return undefined

  • Suggested answer
    Abdul Wahab Profile Picture
    12,119 Moderator on at

    Hi Pradnya Wankhade

    I found a related thread: (+) Xrm.Utility.getGlobalContext().userSettings.roles is unavailable in Web Client UI - Microsoft Dynamics CRM Forum Community Forum

    It is better to create a support ticket from the power admin centre.

  • Suggested answer
    Abdul Wahab Profile Picture
    12,119 Moderator on at

    Hi Pradnya Wankhade,

    You can also use this method: How to Show and Hide Button Based on a Security Role to handle button visibility.

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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Pallavi Phade Profile Picture

Pallavi Phade 98

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 60 Super User 2025 Season 2

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 43 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans