Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Failed to Insert Audit Record After Install of 2016 SP1

(0) ShareShare
ReportReport
Posted on by 35

We just installed SP1 on our CRM 2016 on prem server. I am now receiving the error "Failed to Insert Audit Record" when executing an AddListMembersListRequest. We can add the members manually through the interface but not through code now. We are able to create the marketing list but receive the error when trying to add members via and array of member ids. Error occurs on the Execute line.

AddListMembersListRequest x = new AddListMembersListRequest();
            x.ListId = staticListId;
            x.MemberIds = bidContactList.ToArray();

            AddListMembersListResponse y = (AddListMembersListResponse) orgContext.Execute(x);


*This post is locked for comments

  • woodtool Profile Picture
    woodtool 35 on at
    RE: Failed to Insert Audit Record After Install of 2016 SP1

    This seems to be a different issue now. InnerException: System.Data.SqlClient.SqlException (0x80131904): Violation of PRIMARY KEY constraint 'PK__fn_GetGu__3213E83F5DFCB325'. Cannot insert duplicate key in object 'dbo.@tbl'. The duplicate key value is (00000000-0000-0000-0000-000000000000).

    The statement has been terminated. I'll move to a different post.

  • woodtool Profile Picture
    woodtool 35 on at
    RE: Failed to Insert Audit Record After Install of 2016 SP1

    We have upgraded to 365 v1612 and now we're getting a "General SQL Error" in the same spot. I tried adding back in the "= null" to the stored proc but that didn't fix it. I'll try to get a better error message.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Failed to Insert Audit Record After Install of 2016 SP1

    Has anyone installed the Latest update rollup to confirm if it fixes the issues with Marketing Lists?

    support.microsoft.com/.../update-0.1-for-microsoft-dynamics-crm-2016-service-pack-1

  • DigitalFlow Profile Picture
    DigitalFlow 80 on at
    RE: Failed to Insert Audit Record After Install of 2016 SP1

    Hey everyone,

    We're also experiencing issues with this error when adding users to a team using a plugin.

    As it turns out, the association works when executing the plugin asynchronously, although the plugin execution itself will still be flagged as failed due to the same error.

    If only the results count, switching the plugins to asynchronous execution might be a nicer / supported workaround for the time being, although it should definetly get fixed asap.

    Hope I was able to help someone.

    Kind Regards,

    Florian

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Failed to Insert Audit Record After Install of 2016 SP1

    thanks!

    This issue is still outstanding in CRM 2016 sp1.

  • Henrik Gundersen Profile Picture
    Henrik Gundersen 978 on at
    RE: Failed to Insert Audit Record After Install of 2016 SP1

    Thank you. I have this bug when trying to add and remove members to teams. I cannot wait until SP1 UR1 as this is critical for our operations, so I have reported this as a bug to Microsoft. Hopefully to put some pressure on them to get SP1 UR1 out.

  • Suggested answer
    woodtool Profile Picture
    woodtool 35 on at
    RE: Failed to Insert Audit Record After Install of 2016 SP1

    Update from MS was the they are aware of the problem and have fixed it but they will not be releasing a hotfix. The next release (SP1 UR1) will include the fix. I would follow what Chris Teuben has suggested as that has been working for us for a while too.

  • woodtool Profile Picture
    woodtool 35 on at
    RE: Failed to Insert Audit Record After Install of 2016 SP1

    Thanks. I've already done that as a temp solution. Microsoft is still looking at the underlying issue. I'll keep the post updated if I get a response. Seems to be an issue with the SDK as that is a new field with SP1.

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Failed to Insert Audit Record After Install of 2016 SP1

    I created another workaround by altering the Stored Procedure "p_InsertMultipleAuditRows":

    ALTER   PROCEDURE [dbo].[p_InsertMultipleAuditRows](@doc ntext, @transactionid uniqueidentifier, @EntityType int,

    @auditoperation tinyint, @auditaction tinyint, @audituser uniqueidentifier ,

    @callinguser uniqueidentifier, @attributemask nvarchar(max), @changedata nvarchar(max),

    @audituseradditionalinfo nvarchar(350) = NULL)

    ...


    The "= NULL" addition makes the parameter optional.

    USE AT YOUR OWN RISK!

    As far as I know this kind of hacking into the database is not supported by Microsoft (but if you do, take care to document the changes you make).

    Regards, Chris.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Failed to Insert Audit Record After Install of 2016 SP1

    I too am experiencing this when using the UI to add all members in an advanced find to a marketing list. The only way I can get them to add is by turning off auditing.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,375 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans