locked
EmailAddress1 field issue RRS feed

  • Question

  • Hello,

    In on-premise environment, have increased the length of emailaddress1 field on contact entity from 200 to 254.

    When trying to create a record through SDK, it successfully creates a record with the length of emailaddress1 being 211.

    When trying to update the same record with an emailaddress1 having length more than 200, it results in a "Generic SQL Error"

    Any insight on why this is happening is appreciated.

    Karishma

    Wednesday, February 11, 2015 8:07 AM

Answers

  • Hi Nandan,

    The field length was already modified as per the business requirement.

    Now the way out was to either restrict user from entering string >200 or altering the [AddressUsed] column of [ActivityParty] table.

    Karishma

    Friday, February 13, 2015 8:49 AM

All replies

  • Hello,

    In case you have OnPremice - turn on trace and recheck log - it will contain exception that occurs. In case you have CRM Online I would suggest to get in touch with Microsoft Support.


    Dynamics CRM MVP/ Technical Evangelist at SlickData LLC
    My blog

    Wednesday, February 11, 2015 9:05 AM
    Moderator
  • Hi Andrii,

    Thank you for prompt response.

    Unfortunately I'm unable to find the registry keys to enable tracing, kindly guide me.

    Wednesday, February 11, 2015 9:45 AM
  • Also tried to enable tracing using Windows power Shell.

    But once its enabled, can't see any log files in "C:\Program Files\Microsoft Dynamics CRM\Trace"

    Wednesday, February 11, 2015 9:59 AM
  • Hi Andrii,

    I managed to get the trace file

    Spotted this -

    "Crm Exception: Message: Generic SQL error., ErrorCode: -2147204784, InnerException: System.Data.SqlClient.SqlException (0x80131904): String or binary data would be truncated.
    The statement has been terminated."

    Need help!

    Karishma

    Wednesday, February 11, 2015 10:05 AM
  • In case registry key is not available - just create it (dword type).

    Dynamics CRM MVP/ Technical Evangelist at SlickData LLC
    My blog

    Wednesday, February 11, 2015 10:07 AM
    Moderator
  • Managed to get the trace file, error message as below:

    Exception when executing non-query: update [ActivityPartyBase] set [AddressUsed]='<emailaddress1 of length 209>' where ([PartyId] = '61b7d529-d5b1-e411-bd42-005056952ee1' and [PartyObjectTypeCode] = 2) Exception: System.Data.SqlClient.SqlException (0x80131904): String or binary data would be truncated.
    The statement has been terminated.

    Is there any way to increase the field length of [ActivityPartyBase].[AddressUsed] from nvarchar(200) to nvarchar(254) ?

    shouldn't it have been increased when [Contact].[EMailAddress1] was modified from nvarchar(200) to nvarchar(254) ?

    Karishma 


    Wednesday, February 11, 2015 10:37 AM
  • Unfortunately there is no supported way to increase length of that field. You can try change it in SQL DB but I would not recommend that.

    Dynamics CRM MVP/ Technical Evangelist at SlickData LLC
    My blog

    Wednesday, February 11, 2015 10:51 AM
    Moderator
  • So then how do we handle this issue?
    Wednesday, February 11, 2015 10:55 AM
  • Hi Karishma,

    Please follow this blog, which will guide you to do some pre check bfore u change ur field length.

    http://blog.customereffective.com/blog/2010/09/help-my-field-is-too-short.html

    After performing pre check still if you find SQL time out error:

    You can increase timeout : Please follow below link:

    https://support.microsoft.com/kb/2637855/en-us?wa=wsignin1.0

    Regards,

    Nandan S

    Please "Vote as Answer" is it helped you

    Wednesday, February 11, 2015 11:15 AM
  • Hi Nandan,

    The field length was already modified as per the business requirement.

    Now the way out was to either restrict user from entering string >200 or altering the [AddressUsed] column of [ActivityParty] table.

    Karishma

    Friday, February 13, 2015 8:49 AM