Friday, December 2, 2011

Sharepoint Content Query Error:"One or more field types are not installed properly."

when i contruct a content query with a custom web part to filter the content based on the dropdownlist selection. i compile without any error, then i successfully deployed it to the test server.

After i added this webpart to the page, there is a warming message was shown on the top of the web part.

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

after i google for a bit, and know that sharepoint server complaint about the field did not match any columns in the list.

"<Where><Leq><FieldRef Name=\"Customer_x0020_ID\" /><Value Type=\"DateTime\">{0}</Value></Leq></Where>

the root cause is that the display name is Customer ID shown in the list view.  i think that Customer ID should be the field name that i can use to contruct the query. however, when i view the page source and found that the Internal name of Customer ID is CustomerID without the space.

here is the recontruct query that work with any warming message.

"<Where><Leq><FieldRef Name=\"CustomerID\" /><Value Type=\"DateTime\">{0}</Value></Leq></Where>

please do not delete or remove any column from the list/ library settings, the query complaint about the column is not found, because it verify only by the internal name, not the diplay name shown in the list view. 

the correct solution is click on link of library / list to view the library/list, then right click the page to select view page source to find internal name of fields that you will include in your content query. 

No comments:

Post a Comment