Announcements
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!
You are welcome ! Have a good weekend
Hi Medhi
This is amazing discovery. Thank you for your kind advice. Have a great weekend!
--
Yours
I've replayed the same scenario in two other instances:
it works for the following versions:
it doesn't work for the next version (same error as yours)
I recommend opening a support ticket. Looks like the implementation is not completed for some version.
Hi Josephkm,
I will investigate into other environments and keep you informed.
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."
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)
And I can see the data via the Audit Summary View:
Would you have any experience regarding this too?
Thanks in advance!
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:
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')
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()
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156