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 :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Retrieving OldRolePrivileges and NewRolePrivileges

(0) ShareShare
ReportReport
Posted on by

Hi All

I am trying to do some analysis on the audit table using Power BI.

I am able to make various web api calls and functions like RetrieveRecordChangeHistory, and have successfully worked on the field changes (stored as column number in attributemask column of the audit table).

However, I am stuck with the role and privilege changes. These are stored as GUID in the attributemask column.

Which web api and function calls can I make to retrieve the RolePrivilegeAuditDetail in order to retrieve the OldRolePrivileges and NewRolePrivileges, as described on https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/roleprivilegeauditdetail?view=dynamics-ce-odata-9 ?

Any help is appreciated.

I am using v9.2

Thanks!

I have the same question (0)
  • Verified answer
    meelamri Profile Picture
    13,216 User Group Leader on at

    Hi Josephkm, 

    I tried to do the same thing on my test environment, I got the following result. 

    In order to have RolePrivilegeAuditDetail you will need to execute the Microsoft.Dynamics.CRM.RetrieveAuditDetails() function on an audit with the event "Replace Privileges In Role".

    Example: 

    pastedimage1613040695003v1.png

    The audit record related to this update: 

    https://xxxx.crm.dynamics.com/api/data/v9.1/audits?$filter=action eq 59 and Microsoft.Dynamics.CRM.Today(PropertyName='createdon')

    pastedimage1613041290989v2.png

    Then when you perform your function Microsoft.Dynamics.CRM.RetrieveAuditDetails(): 

    https://xxxx.crm.dynamics.com/api/data/v9.2/audits(e5e448e9-566c-eb11-9889-281878f0b22c)/Microsoft.Dynamics.CRM.RetrieveAuditDetails()

    pastedimage1613041564513v3.png

  • Josephkm_lim Profile Picture
    on at

    Hi Medhi

    Many thanks for your advice. It's great and useful!

    However, I encountered an error when I execute:

    https://xxxx.crm.dynamics.com/api/data/v9.2/audits(auditid GUID)/Microsoft.Dynamics.CRM.RetrieveAuditDetails()

    "Object reference not set to an instance of an object."

    pastedimage1613088533065v1.png

    I don't understand what could have caused it since I have the audit record when I execute:

    https://xxxx.crm.dynamics.com/api/data/v9.2/audits(auditid GUID)

    pastedimage1613089338122v2.png

    And I can see the data via the Audit Summary View:

    pastedimage1613089996082v2.png

    Would you have any experience regarding this too?

    Thanks in advance!

  • meelamri Profile Picture
    13,216 User Group Leader on at

    Hi Josephkm,

    I will investigate into other environments and keep you informed.

  • Suggested answer
    meelamri Profile Picture
    13,216 User Group Leader on at

    I've replayed the same scenario in two other instances:

    it works for the following versions:

    • 2020 release wave 2 enabled/ Server version: 9.2.20123.00153/ Client version: 1.4.2135-2012.3
    • 2021 release wave 1 enabled/Server version: 9.2.20123.00153/Client version: 1.4.2135-2012.3

    it doesn't work for the next version (same error as yours)

    • 2020 release wave 2 enabled/Server version: 9.2.21012.00146/Client version: 1.4.2134-2101.2

    I recommend opening a support ticket. Looks like the implementation is not completed for some version. 

  • Josephkm_lim Profile Picture
    on at

    Hi Medhi

    This is amazing discovery. Thank you for your kind advice. Have a great weekend!

    --

    Yours

  • meelamri Profile Picture
    13,216 User Group Leader on at

    You are welcome ! Have a good weekend

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 > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 76

#3
Martin Dráb Profile Picture

Martin Dráb 66 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans