SharePoint Experts, Information Architects, Expert Witness

We provide consulting in a broad array of business and technology from architecture to design to deployment of global systems with a focus on surfacing data in the enterprise. Specialists in Microsoft, we are a premier provider of SharePoint Expertise (including 2016 and Office 365). We also provide Expert Witness/Legal Expert in eDiscovery, source discovery, patent infringement, piracy and more! We also have established SICG DLDS s.a. - our counterpart in Costa Rica that specializes in water systems (http://www.crwatersolutions.com) - Contact me direct: david_sterling@sterling-consulting.com or call 704-873-8846 x704.

Search This Blog

Friday, July 8, 2011

SharePoint 2010 ListDefintion Edit Fails with "Object reference not set"

So you create a new custom List Defintion in SharePoint 2010 - deploy it to the site and it creates fine. You even add an item and works but then you go to edit it and you get either the dummy error page or you get "Object reference not set".

Turns out the problem is quite easy to fix - it simply means that one of the fields you created in the list has a duplicate GUID (or you used one that is already in use by another field) OR you didn't add the the a field in the <FieldDefs> section.

Check the FieldDefs first and if they look OK, it is probably a GUID - simply go back through your Schema.xml file and check each one of the GUID's - be sure all of them are unique and that you DON'T change the GUID of the Title, LinkTitle or LinkTitleNoMenu fields if you are modifying them (i.e. like changing the display name). In one case I had to change each field until I found the offending one. Don't forget to use the MakeGuid utility (either through Visual Studio : Tools > Create GUID) or you can always download it.

FYI - Many of us end up changing the Title field - for this field, the following GUID's apply:
  • Title | fa564e0f-0c70-4ab9-b863-0177e6ddd247
  • LinkTitle | bc91a437-52e7-49e1-8c4e-4698904b2b6d
  • LinkTitleNoMenu | 82642ec8-ef9b-478f-acf9-31f7d45fbc31
If you want to change the Title field (the display name for example), you have to specify the field just like those you are creating but being sure to use the Name/StaticName and GUID's from above.

No comments: