SharePoint 2013 – One or more field types are not installed properly

One or more field types are not installed properly

Today I got this error

Microsoft.SharePoint.SPException: One or more field types are not installed properly. Go to the list settings page to delete these fields. —> System.Runtime.InteropServices.COMException: One or more field types are not installed properly. Go to the list settings page to delete these fields.0x81020014 at Microsoft.SharePoint.Library.SPRequestInternalClass.GetListItemDataWithCallback2(IListItemSqlClient pSqlClient, String bstrUrl, String bstrListName, String bstrViewName, String bstrViewXml, SAFEARRAYFLAGS fSafeArrayFlags, ISP2DSafeArrayWriter pSACallback, ISPDataCallback pPagingCallback, ISPDataCallback pPagingPrevCallback, ISPDataCallback pFilterLinkCallback, ISPDataCallback pSchemaCallback, ISPDataCallback pRowCountCallback, Boolean& pbMaximalView) at Microsoft.SharePoint.Library.SPRequest.GetListItemDataWithCallback2(IListItemSqlClient pSqlClient, String bstrUrl, String bstrListName, String bstrViewName, String bstrViewXml, SAFEARRAYFLAGS fSafeArrayFlags, ISP2DSafeArrayWriter pSACallback, ISPDataCallback pPagingCallback, ISPDataCallback pPagingPrevCallback, ISPDataCallback pFilterLinkCallback, ISPDataCallback pSchemaCallback, ISPDataCallback pRowCountCallback, Boolean& pbMaximalView) — End of inner exception stack trace — at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx) at Microsoft.SharePoint.Library.SPRequest.GetListItemDataWithCallback2(IListItemSqlClient pSqlClient, String bstrUrl, String bstrListName, String bstrViewName, String bstrViewXml, SAFEARRAYFLAGS fSafeArrayFlags, ISP2DSafeArrayWriter pSACallback, ISPDataCallback pPagingCallback, ISPDataCallback pPagingPrevCallback, ISPDataCallback pFilterLinkCallback, ISPDataCallback pSchemaCallback, ISPDataCallback pRowCountCallback, Boolean& pbMaximalView) at Microsoft.SharePoint.SPListItemCollection.EnsureListItemsData() at Microsoft.SharePoint.SPListItemCollection.get_Count() at MyCorp.SharePoint.Branding.LinksControl.Page_Load(Object sender, EventArgs e)

I was running the following code within a User Control

SPQuery query = new SPQuery();

query.Query = “<Where><Eq><FieldRef Name=’LinkSection’ /><Value Type=’Text’>” + “Top Navigation” + “</Value></Eq></Where>”;

query.ViewFields = “<FieldRef Name=’LinksUrl’ /><FieldRef Name=’Title’ />”;

SPListItemCollection items = list.GetItems(query);

if (items.Count > 0 )

{

}

The items.Count was generating the above error. Aha, something wrong with the list?! Wrong!!

The Solution

Something wrong with the query.

Name=’LinkSection’

My custom field was called LinksSection. So a simple typo and yet another half an hour gone as the error was pointing me in the wrong direction.


Discover more from SharePains

Subscribe to get the latest posts sent to your email.

Related Posts

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from SharePains

Subscribe now to keep reading and get access to the full archive.

Continue reading