Search code examples
dynamics-crm

Generic SQL Error - Subject on Appointment


Just discovered what I think is a bug in CRM and am hoping someone can clarify for me.

In our solution (CRM 2016 8.1.0.359) we have increased the length of the Subject field on Appointment to 450 characters. One of our testers reported that when saving a new Appointment with a long string in the Subject line she was getting a generic SQL error.

Taking a closer I look I noticed that if you enter a string with more than 200 characters (the length of Subject on the Activity entity) is when the error occurs. It seems like CRM or rather the SQL database is ignoring the increased column size defined on Appointment and instead is using the column length that comes from the parent Activity entity.

Just to clarify, I've tried to replicate this on a CRM 2013 environment and it works as expected there. It just seems to not be working in our current version of CRM. Was this a bug that was introduced in 2016? Has it since been resolved in a rollup? Has anyone experienced it before?


Solution

  • I just tested this with an on-premises instance of 8.1.0.359 and did not get an error.

    I first confirmed that I could not enter more than 200 characters into the Subject field. Then I increased the Appointment's Subject field to 400 characters and published changes. Then I entered a 300 character string and saved the record, it saved without error. I did a SQL query to confirm it saved correctly to the database.

    If you are on-premises take a look at the organization's DB in SQL. The ActivityPointerBase.Subject field is where this value is stored. Prior to changing the Appointment Subject field size this field was nvarchar(200). After making the change I refreshed the SQL Management Studio view and the field was nvarchar(400).

    My first suggestion is to change the size to a smaller length and publish. Then change it back to 400 and publish (the publish shouldn't be necessary, but I've seen it resolve strange things before.) It is possible that for some reason the change was saved but the full process didn't execute.

    If that does not resolve it I recommend looking at the verbose trace logs to see what is happening (if you are on-premises) or opening a support ticket (if you are online.)