Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Fetch record audit history using RetrieveAuditDetailsRequest in C#

$
0
0

I am trying to fetch the audit history of a user from CRM. My code is shown below. However at run time i get an exception "audit With Id = c011f583-8741-e211-bce3-78e7d1622fbb Does Not Exist".

Am I missing something?. Please suggest.

Entity entUser = (from name in context.CreateQuery(Constant.SystemUser.EntityLogicalName)

                                  where name.GetAttributeValue<string>(Constant.SystemUser.FullName) == "Sample"

                                  select name).FirstOrDefault();

 

var auditDetailsRequest = new RetrieveAuditDetailsRequest

                {

                    AuditId = entUser.Id

                };

using (OrganizationServiceProxy organizationProxy = CRMHelper.GetServiceProxy())

                {

                    var auditDetailsResponse = organizationProxy.Execute(auditDetailsRequest);

                }


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>