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

by Mark Deraeve 1. August 2008 05:23

I was trying to order a query on a document library to get all document names ordered in a dropdown. The code looked like this: 

SPList docLib = getDocLib();
 
SPQuery oQuery = new SPQuery();
oQuery.ViewXml = "<View><Query><OrderBy><FieldRef
 Name='Name'/></OrderBy><Where><Gt><FieldRef Name='ID'/>"
 + "<Value Type='Text'>0</Value></Gt></Where></Query></View>";
SPListItemCollection collListItems = docLib.GetItems(oQuery);

 

When I executed the code, I got the error: "One or more field types are not installed properly. Go to the list settings page to delete these fields.". So I first looked around but could not find the correct google words. I had to find it myself. I saved the list as a template, downloaded the stp file and opened it with winzip. The next thing I did was opening the manifest.xml file. I pressed ctrl-f and searched for the string: "FieldRef". Then you will find this in the manifest.xml file:

<ViewFields>
<FieldRef Name="DocIcon"/>
<FieldRef Name="LinkFilename"/>
<FieldRef Name="Modified"/>
<FieldRef Name="Editor"/>
<FieldRef Name="SOPAppro"/>
<FieldRef Name="_Status"/>
<FieldRef Name="SOP_x0020_type"/>
</ViewFields> 

 

I found a field called: LinkFileName.  I decided to use this in the query, and guess what, it worked. The names we see are not always the names SharePoint uses. This is mainly for fields that are defined by SharePoint itself. So my code looks like this now:

SPList docLib = getDocLib();
 
SPQuery oQuery = new SPQuery();
oQuery.ViewXml = "<View><Query><OrderBy><FieldRef
 Name='LinkFilename'/></OrderBy><Where><Gt><FieldRef Name='ID'/>"
 + "<Value Type='Text'>0</Value></Gt></Where></Query></View>";
SPListItemCollection collListItems = docLib.GetItems(oQuery);

 

And it does the trick. So if you are looking for field name in WSS, you can try it this way.

 


Tags:

Comments (9) -

Mark
Mark
2/12/2009 10:41:52 AM #

I'll have to check out this tool to perform the program:
http://code.msdn.microsoft.com/SPDisposeCheck

austin personal injury
austin personal injury United States
1/4/2014 7:10:40 AM #

I want quotation your article to my private site.

car accident attorney Austin
car accident attorney Austin United States
1/9/2014 7:54:50 AM #

But, what in regards to the conclusion? Will you be particular concerning the supply? Sure I am. Very energetic post, I relished that bit. Wiill there be described as a section 2? Hi there, thee whole thing is likely sound here and ofcourse just about every

car accident attorney Austin
car accident attorney Austin United States
1/23/2014 6:01:45 PM #

Feel free to check out my web page - viagra - mobile.fling.com/.../ Hello there to every body, it truly is my first take a look at of this weblog; this webpage consists of wonderful as well as in fact excellent substance designed for readers.

accident attorney Austin
accident attorney Austin United States
1/26/2014 12:14:19 PM #

Feel free to visit my internet web site viagra online - medellinlibre.co/wiki/index.php?title=Usuario:Jess05Gieoofyn Good day there! Would you use Twitter? I'd wish to follow you if that could be ok. I'm certainly enjoying your blog and look ahead to new posts. Truly relished the great facts in this article, thanks a whole lot. You must participate inside of a contest for top-of-the-line blogs to the world-wide-web. I'll advocate this web site! These are genuinely wonderful tips in regarding blogging. You have got touched some superior points in this article. Any way keep up wrinting.

accident attorney Austin
accident attorney Austin United States
2/25/2014 12:16:40 AM #

my web site - viagra on the internet - wiki.ku.dk/discoverer/index.php?title=Bruger:Shonda02Ybx Excellent tips for new bloggers. Countless men and women focus on Web site rank. Web page rank is useless if the web site does not have very good articles. Ideal now it looks like Wordpress is the ideal running a blog platform available correct now. (from what I have study) Is that what you're utilizing on your own weblog? I almost acquired an heart attac, due in your set of volume. Excellent things even so! Superior tips for new bloggers. So many men and women focus on Website page rank. Page rank is useless if the web site doesn't have excellent information. Fantastic ideas for new bloggers. A lot of people today focus on Web site rank. Web page rank is useless if the web-site doesn't have superior content. I'm unsure exactly where you are getting your info, but fantastic subject matter. I needs to spend a while understanding a great deal more or knowledge far more. Many thanks for wonderful information and facts I used to be seeking for this data for my mission.

Alene Rensberger
Alene Rensberger United States
3/5/2014 9:02:13 PM #

Hey there, You've performed an amazing work. I'll surely delicious them and personally advise to my pals. I  am assured they'll be benefited from this blog.

Luigi Fulk
Luigi Fulk United States
3/27/2014 10:56:59 AM #

Sorry for the huge review, but I'm really loving the new Zune, and hope this, as well as the excellent reviews some other people have written, will help you decide if it's the right choice for you.

million hits secret review
million hits secret review United States
8/9/2014 11:36:33 AM #

What would most people do minus the excellent ideas you write about on this website? Who has the fortitude to deal with important topics just for common readers like me? My spouse and i and my buddies are very delighted to have your web site among the types we frequently visit. We hope you know how significantly we love your effort! Best wishes through us all.

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

About the author

I started as a VB6 developer, programming all kinds of applications. I also got involved in the development of a e-market in ASP.

When .Net was introduced, I had the privilege to start in a team of professionals and develop a framework. I learned a lot and started to work as a c#.Net consultant from then on.

After 2 years I also got the chance to work for several months with Sharepoint. Sharepoint kept chasing me all the years after and when the product got more and more mature I started to love it. Now Sharepoint is a somewhat daily occupation for me. I implemented a large quality document management system at PMRL being the only developper/technical analyst. Working close togehter with the QA department we succeeded in making and improving a very good Quality document management system. Its used up until this day.

I worked for 6 years as a .Net consultant for 2 of the largest consultancy companies in Belgium. I mainly worked as a Sharepoint engineer, but also .Net expert and several ASP.Net and Windows applications. One of my last projects with the consultancy was creating a custom LIMS system. This was a succes and the customer asked me to stay and help to expand and maintain this LIMS. I had great years in this company. There was a focus on innovation and a lot of opportunities for improving and developping new IS systems. Apart from several small projects I further more improved the custom LIMS system, created a SOP library based on Sharepoint and a web based Skill matrix system to handle the skills of the employees in the company. 

Then I was involved in transferring the LIMS to a new lab in Singapore. This was done in a short time frame. The deployment was again a success and it passed the GLP inspection tests. I learned a lot from the Quality engineers about validation of computerized systems.

At my current job I have a wide range of challenges. Mainly I'm still working with .Net (VB.net and C#.Net). But outside of the Microsoft world I also do some ABAB programming in our SAP system. Like developing Adobe Forms and the program behind it. Or making small changes to customized code.

Latest I started to follow a course from Stanford Univercity on Objective C programming for IPAD and IPHONE.I just finished the first app for IPad and it appears to be a great succes. People in the factory are working with IPad to take pictures and upload them to orders. Already more and more projects are coming my way. The iOS apps are supported by a home made .Net architecture that exposes WCF services. Its working great. My second app is almost ready for deployment in factories. Now I started an App for the management team so they can manage projects on their IPAD and IPHONE.

My linkedIn!

Month List

Tag cloud

Locations of visitors to this page