Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Auditing Entity Changes

Posted on by 377

Hi, i'm having a confusion about DeleteAuditDataRequest. Does it only delete audit partitions for end date or audited records  without deleting the partition?.I am having an requirement where i need to delete audit history for the specific entity, but in my research i didn't found anything.  If anyone know solution for my problem please let  me know. Thanks .

*This post is locked for comments

  • ZeroHar Profile Picture
    ZeroHar 377 on at
    RE: Auditing Entity Changes

    Yes . DeleteRecordChangeHistoryRequest allows you to delete history for the specific entity

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Auditing Entity Changes

    Hello ZeroHar.

    Did you get any solution regarding the deletion of audit log for the specific entity?
    We also have a similar requirement for version 9.0.

    Please reply ASAP if you found any solutions.

    Any help would be much appreciated.

  • ZeroHar Profile Picture
    ZeroHar 377 on at
    RE: Auditing Entity Changes

    Thanks for the  reply. For the web API use i'm trying to use DeleteRecordChangeHistory Action , but all the time i'm getting bad response.  Here is my code . i am not sure i'm sending correct parameters. and i didn't see  DeleteRecordChangeHistory Action inside of my crm, but it's available in rest builder. Any idea?

    Dynamics 365 Online , version 9.0.2

    var parameters = {};

    var target = {};

    target.primarykeyid = ""00000000-0000-0000-0000-000000000000";  // entity id

    //target["@odata.type"] = "Microsoft.Dynamics.CRM.entitylogicalname";

    //target["@odata.type"] = "Microsoft.Dynamics.CRM.account";

    target["@odata.type"] = "account";

    parameters.Target = target;

    var req = new XMLHttpRequest();

    req.open("POST", Xrm.Page.context.getClientUrl() + "/api/data/v8.2/DeleteRecordChangeHistory", true);

    req.setRequestHeader("OData-MaxVersion", "4.0");

    req.setRequestHeader("OData-Version", "4.0");

    req.setRequestHeader("Accept", "application/json");

    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");

    req.onreadystatechange = function () {

    if (this.readyState === 4) {

    req.onreadystatechange = null;

    if (this.status === 200) {

    var results = JSON.parse(this.response);

    } else {

    Xrm.Utility.alertDialog(this.statusText);

    }

    }

    };

    req.send(JSON.stringify(parameters));

    }

  • Verified answer
    David Jennaway Profile Picture
    David Jennaway 14,063 on at
    RE: Auditing Entity Changes

    The DeleteAuditDataRequest is used to delete data by partition. There's now a DeleteRecordChangeHistoryRequest that will allow you to delete audit history for a specific entity - this is available for CRM 9.0 and 8.2, but not earlier versions

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans