SharePoint 2010: One or More Field Types are not Installed Properly. Go to the List Settings Page to Delete These Fields in Executing CAML Queries
Issue
Developer was trying to use a CAML query and was getting this error:
"One or more field types are not installed properly. Go to the list settings page to delete these fields".
Troubleshooting
Checked the fields and they were fine.
Executed a few other queries and found that they were working fine.
Solution
This was a clear indication that there was something wrong in the query rather than in the list settings. The query had a column "Approval Status". To verify whether it is causing the issue or not execute a small piece of code to get the internal name and check that the internal name of this field is "_ModerationStatus".
Changed the value in the query and it should work fine.
A small piece of code for reference:
SPQuery query = new SPQuery();
String camlQuery = "<Where><Eq><FieldRef Name='_ModerationStatus'/><Value Type='Text'>Pending</Value></Eq></Where>";
query.Query = camlQuery;
SPListItemCollection items = list.GetItems(query);