Notifications
Announcements
No record found.
I am trying to iterate through the result of the Xrm.Utility.getGlobalContext().userSettings.roles.getAll() function but when stored in an array, it returns undefined. However when the function is run as is, it returns everything that I need. Can anyone help me out on this? This has been a roadblock to me for quite a few days now. I can't find anything that works from all the other answers I have found here.
Hi kthlnvrgna,
If I am not wrong, the screenshot you provided is the watch from Developer Tools. forEach function wouldn't return the output in watch. You can either go to Console in Developer Tools to see the output or place the same javascript code in webresource by replacing console.log() with alert() so that, you can see the output in alert window.
Watch output under Console:
Javascript Code in webresource:
I am actually in testing on the Console of the Developer tools. And have already tried to simulate in the web resource, it really doesn't return anything. Am I doing something wrong?
May I also ask why you had to have explicitly defined your object for the System Administrator in your forEach()?
Oddly it's working with alert(). Thanks for this.
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.
Tom_Gioielli 70 Super User 2025 Season 2
Gerardo RenterÃa Ga... 33 Most Valuable Professional
Daniyal Khaleel 32 Most Valuable Professional