Friday, May 21, 2010

SPWeb ProcessBatchData - One or more field types are not installed properly

I've created a SharePoint Timer Job that will process the contents of a tab delimetered text file, parse it through an XML field definition file, that details information on what to do with each tabbed column, and pushes it in to a nominated list in SharePoint.



To do this efficiently, I've used the ProcessBatchData method of the SPWeb object. Initially, it worked, with a sample set of about 3 columns. However, with more and more columns added, I began to receive the following error messages, as returned by the ProcessBatchData method:




<Result ID="" Code="-2130575340"><ErrorText>One or more field types are not installed properly. Go to the list settings page to delete these fields.</ErrorText></Result>



<Result ID="" Code="-2147023673"><ErrorText>The operation failed because an unexpected error occurred. (Result Code: 0x800704c7)</ErrorText></Result>


I've encountered such problems in the past - particularly the error "One or more field types are not installed properly. Go to the list settings page to delete these fields." would sometimes mean the field name defined in the operation did not match the field name in the destination list.



However, after carefully looking over the field names defined in my XML field definition file, and comparing them to the field names in the detination list, they were exactly the same.



What I found instead, after a lot of trial and error removing and adding each field in the definition file, the SharePoint field names with more than 2 space characters cause these same errors.


The following field names resulted in "One or more field types are not installed" errors:



  • Contact Other Given Name

  • SON Address Line 1

  • SON Address Line 2


I changed the field names to the following, and everything started to work:



  • Contact Other Given

  • SON Address Line1

  • SON Address Line2


Also worth noting that the field names to use in your ProcessBatchData operation should refer to the Internal field name, not the Display Name. This essentially means you must refer to the field name that was originally used when creating the column in SharePoint. Any subsequent change to the column name is simply a change in the Display name, and will not work when referring to it in the ProcessBatchData operation.

No comments:

Post a Comment