sharepoint - SPListItem.Update() throws exception when trying to update Title. 255 char limit issue with encoding -


it seems have issue encoding. field max width 255 chars , title indeed 255 chars, there characters in title (quotes , angle brackets) encoded sharepoint, pushing title width on 255 char limit.

this leaves me in unsupported state. updates both via sp object model , via list service. general exception:

error code: 0x80040e21  operation failed because unexpected error occurred. (result code: 0x80040e21) 

are there options getting out of broken state, short of deleting , recreating content?

this seems unhandled exception bubbling com layer instead of being trapped more directly in spitem. since there no validation around assignment field, can assign invalid value (in case value > 255 characters) , failure occurs when .update() called, giving more vague error expected.

workaround: expand title encoding , trimming necessary.


Comments