Quantcast
Channel: entwicklungsgedanken » SharePoint-Development
Viewing all articles
Browse latest Browse all 12

One possible reason for 0x81020014 when querying a list for items in SharePoint

$
0
0

If you get that “famous” error: One or more field types are not installed properly. Go to the list settings page to delete these fields.0x81020014 you are given absolutely no hint which field and whats wrong with your SPQuery.Query

I’m always using SPBuildInFieldId with the FieldRef-statements for out-of-the-box fields so a typo was not the case. But the case was the problem!

var query = new SPQuery();
query.Query = String.Format("<Where><And><Eq><FieldRef Id=\"{0}\" /><Value Type=\"Text\">{1}</Value></Eq></Where>", SPBuiltInFieldId.FileLeafRef, "the-file.name");

This code throws the exception. The following code works!

var query = new SPQuery();
query.Query = String.Format("<Where><And><Eq><FieldRef ID=\"{0}\" /><Value Type=\"Text\">{1}</Value></Eq></Where>", SPBuiltInFieldId.FileLeafRef, "the-file.name");

The only difference is Id is now ID. So in SharePoint Id != ID


Viewing all articles
Browse latest Browse all 12

Trending Articles