Home > Development, SharePoint > One or more field types are not installed properly. Go to the list settings page to delete these fields.

One or more field types are not installed properly. Go to the list settings page to delete these fields.


This blog post (and eventual updates) can now be found at my new blog : http://www.koenvosters.be 
Url of this blog post: http://www.koenvosters.be/post/one-or-more-field-types-are-not-installed-properly-go-to-the-list-settings-page-to-delete-these-fields.aspx

Today one of our developers got this error when using an SPQuery. He asked me to help out, and in most cases it means that you are not using the internal name of the field. So that was the first step I took to replace his code and use the internal name of the field. The best way of course would be to use the internal field as a parameter:

q.Query = string.Format(“<Where>” +

“<And>” +

“<Eq>” +

“<FieldRef Name=\”{0}\”></FieldRef><Value Type=\”Boolean\”>1</Value></Eq>” +

“<Eq><FieldRef Name=\”{1}\”></FieldRef><Value Type=\”Boolean\”>1</Value>” +

“</Eq>” +

“</And>” +

“</Where>”, spField1.InternalName, spfield2.InternalName);

After doing that, it still gave the same error. Debugging it showed us that the same error kept popping up, although the internal field names were used. Last resort was to use the U2U CAML Query builder and see if anything was wrong. It appeared that the </Eq><Eq> was missing between the FieldRefs. This is what the correct query string should be:

q.Query = string.Format(“<Where>” +

“<And>” +

“<Eq>” +

“<FieldRef Name=\”{0}\”></FieldRef><Value Type=\”Boolean\”>1</Value></Eq>” +

“<Eq><FieldRef Name=\”{1}\”></FieldRef><Value Type=\”Boolean\”>1</Value>” +

“</Eq>” +

“</And>” +

“</Where>”, spField1.InternalName, spfield2.InternalName);

So even though the error message usually means that your internal names are not correct, messing up the query with the <Eq> tags seems to result in the same error.

Advertisements
Categories: Development, SharePoint
  1. March 7, 2010 at 2:49 pm

    Hrmm that was weird, my comment got eaten. Anywho I wanted to say that it’s nice to know that someone else also touched on this as I had trouble finding the same information elsewhere. This was the first place that helped me understand this. Thanks.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: