MS CRM 2011: Error during creation of Account record – System.Data.SqlClient.SqlException (0x80131904): Cannot insert duplicate key row in object ‘dbo.EmailSearchBase’ with unique index ‘ndx_for_forward_update’

Today I have got this issue during creation of account. I have googled and found the same issue at CRM Development forum.

I have analyzed plugin’s code and schematically it looked like:


The key points to reproduce error are:

1. Plugin should be registered to handle Create message in Synchronous Post-Operation mode.

2. Entity should be emailable (like contact, account or lead).

3. Email address should be filled at creation form.

Here are possible ways out to solve this issue:

1. For lazy guys who don’t want to update, rebuild and redeploy plugins the way out is to register plugin as Asynchronous.

2. For developers who are not afraid to redesign code it is possible to use following approach:


In case you would not choose 2-nd way you should know about side affect of first approach – plugins that handle Update message for some fields that were passed to current plugin context would be triggered.


  1. What if you need to update specifically the email field and have a plugin registered with the email field in the filter attributes ?

  2. Hello Andrii.
    I have faced the same issue but with Dynamics 365 (9.0) Online.
    In My case i’m creating account records from external web service (integration service). I don’t know how to fix this issue.

    It occures whe I’m creating account with emailaddress1 filled.
    With empty value all works fine.

    Only one way helps me: create account without emailaddress1 then update it.

    Do you have any update about this issue?

    Thank you in advanced.

      1. I have no plugins for this entity. Only default ActivityFeeds. But I tried to disable it and create new account. The same…
        That’s why this issue so strange.
        The way of creation and updating look like workaround in my case but it shouldn’t work like this 🙁

        1. 3 more questions – have you tried to create a record just from UI? Do you experience same issues?
          Is there a chance that you have real-time workflows that handle create event of accounts?
          What ‘s the exact exception do you get? Is it “Generic SQL exception”?

        2. Andrii,
          1) ui works
          2) there are no any other kind of process
          3) generic sql error

        3. Serhii,
          I believe that the last resort for you is to open support ticket with Microsoft and ask for explanation. BTW I experienced several weird floating issues with 9.0 in several environments so that could be another “floating” bug.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.