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 100

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!

  • Suggested answer
    Abdul Wahab Profile Picture
    12,085 Moderator on at
    RE: Regarding User Security Roles

    Hi Pradnya Wankhade,

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

  • Suggested answer
    Abdul Wahab Profile Picture
    12,085 Moderator on at
    RE: Regarding User Security Roles

    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.

  • Pradnya Wankhade Profile Picture
    100 on at
    RE: Regarding User Security Roles

    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,085 Moderator on at
    RE: Regarding User Security Roles

    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?

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,129 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,895 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans