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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Find Role and Duty by X++ code

(0) ShareShare
ReportReport
Posted on by 229

Hi guys,

Hi  ,

I'm learning some tips on D365 security role.

I'm trying to reach Role and Duty in code but dont find anything on the subject.

Someone know how to do it ?

Thanksfully.

I have the same question (0)
  • Awaxx Profile Picture
    229 on at

    Yes i got it now.

    I found a way to reach my goal too.

    Thank you for your help.

  • André Arnaud de Calavon Profile Picture
    301,908 Super User 2025 Season 2 on at

    Hi Mack,

    Alex showed the way how to interact with the class in coding. There is no object in the AOT which shows the contents of the message as it is a referenced dll. There is no documentation available for this dll. We learned it ourselves by trying out all methods and variables and look at how Microsoft is using it themselves.

  • Verified answer
    alexmeyer.itguy Profile Picture
    670 on at

    Did you add in the required references?

    pastedimage1656512398877v1.png

  • Awaxx Profile Picture
    229 on at

    Hi Andre Arnaud de Calavon ,

    My business requirement are not so weird, just find a way to create a customize form to manage roles, duties and privileges. I know standard exist and do it well, but i just wanna train myself to find other ways to do it like tools you mentionned (Fastpath and S & C Studio).

    It's a way to discover security class and manipulate security datas.

    Thanksfully.

  • Awaxx Profile Picture
    229 on at

    Hello ,

    First, what i'm trying to do is to simplify form for managing roles, duties and privileges and improve my knowledge on the subject. I need to find a way to update my change on permission in privileges, for example changing the access for 'all customers' screen but by the code on a new customize security form.

    Secondly, I tried to reach SecurityRepository class, but didn't find it on the AOT.

    Where could i find it ?

    Thanksfully.

  • André Arnaud de Calavon Profile Picture
    301,908 Super User 2025 Season 2 on at

    Hi Mack,

    Like mentioned by Martin, first try to use the standard features. You only mentioned you want to change duties and privileges, but you didn't share the business requirement or gaps which might be identified. There are ISV solutions like Fastpath (mentioned by Alex) and Security & Compliance Studio from To-Increase which both offer more functionality compared to the standard.

  • alexmeyer.itguy Profile Picture
    670 on at

    Mack,

    You will have to be more specific on what you are trying to do with the roles and duties you are referring to.

    If you are just wanting to query them, there are data entities available (SecurityRoles and SecurityDuties)

    pastedimage1656430079738v2.png

    pastedimage1656430130841v3.png

    Quick Edit:

    It looks like there was some discussion on this post after I started replying, based on your replies I can't answer directly as the company I work for (Fastpath) has a product that does just what you are asking for called Security Designer (https://www.gofastpath.com/grc-for-dynamics-365-fo#tab-7) so it would be under their IP.

    If you really want to go down this path, you can start by looking at the SecurityRepository class.

  • Suggested answer
    Martin Dráb Profile Picture
    238,324 Most Valuable Professional on at

    Don't reivent the wheel - there already is standard GUI for this purpose. See System administration > Security > Security configuration.

    If you're missing something there, you can extend the standard solution. Don't try to create a parallel solution doing the same thing.

  • Awaxx Profile Picture
    229 on at

    I'm gonna try creating a custom form for security role attribution

  • Martin Dráb Profile Picture
    238,324 Most Valuable Professional on at

    What would be a reason for that?

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

News and Announcements

Season of Giving Solutions is Here!

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 843 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 503 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 288 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans