SQL error caused by Email field in Account Create event - CRM 2013 RRS feed

  • Question

  • I am getting an SQL error when I am trying to create a new account.  This error only happens when there is data in the Email field on the account form.  

    I have written some add on code in c# that generates a new account number when the account is created, but this code does not reference the email field anywhere.

    Once the record is created, I am able to fill in the Account's e mail address.  

    I get the following error:


    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Generic SQL error.Detail: 
    <OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
      <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
      <Message>Generic SQL error.</Message>
      <InnerFault i:nil="true" />
      <TraceText i:nil="true" />

    Christo Vermeulen

    Friday, December 12, 2014 7:14 AM

All replies

  • Hi Christo,

    Please have a look at Event Viewer for further details on the error. Also please check if there is any long running synchrnous plugin in Account Entity which deals with this Email field.

    If my response answered your question, please "mark the response as an answer" and also "vote as helpful". Regards, Hari. www.crm2011byhari.blogspot.com

    Friday, December 12, 2014 8:59 AM
  • This is all I get from the event log:

    The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs.

    Christo Vermeulen

    Friday, December 12, 2014 9:33 AM
  • Can you enable tracing, and see what error you get ?

    Also, how does your code write the new account number ? If the code runs in a synchronous post event, and calls an Update, then I think this can result in this error. If this is the case, change your code to run in a pre event, and modify the Target InputParameter

    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    Friday, December 12, 2014 12:13 PM