0
votes

I am trying to fetch data from SP list using the CAML query listed below.

CAML Query

oQuery.Query = "<Where><Eq><FieldRef Name='" 
    + jTitleMappingList.Fields["SET Area"].InternalName + "'/>"
    + "<Value Type='LOOKUP'>" + ddlSubsite.SelectedValue
    + "</Value></Eq></Where>";

Error Message Faced:

{Microsoft.SharePoint.SPException: One or more field types are not installed properly. Go to the list settings page to delete these fields. ---> System.Runtime.InteropServices.COMException (0x81020014): One or more field types are not installed properly. Go to the list settings page to delete these fields. at Microsoft.SharePoint.Library.SPRequestInternalClass.GetListItemDataWithCallback2(IListItemSqlClient pSqlClient, String bstrUrl, String bstrListName, String bstrViewName, String bstrViewXml, SAFEARRAYFLAGS fSafeArrayFlags, ISP2DSafeArrayWriter pSACallback, ISPDataCallback pPagingCallback, ISPDataCallback pPagingPrevCallback, ISPDataCallback pFilterLinkCallback, ISPDataCallback pSchemaCallback, ISPDataCallback pRowCountCallback, Boolean& pbMaximalView) at Microsoft.SharePoint.Library.SPRequest.GetListItemDataWithCallback2(IListItemSqlClient pSqlClient, String bstrUrl, String bstrListName, String bstrViewName, String bstrViewXml, SAFEARRAYFLAGS fSafeArrayFlags, ISP2DSafeArrayWriter pSACallback, ISPDataCallback pPagingCallback, ISPDataCallback pPagingPrevCallback, ISPDataCallback pFilterLinkCallback, ISPDataCallback pSchemaCallback, ISPDataCallback pRowCountCallback, Boolean& pbMaximalView) --- End of inner exception stack trace --- at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)
at Microsoft.SharePoint.Library.SPRequest.GetListItemDataWithCallback2(IListItemSqlClient pSqlClient, String bstrUrl, String bstrListName, String bstrViewName, String bstrViewXml, SAFEARRAYFLAGS fSafeArrayFlags, ISP2DSafeArrayWriter pSACallback, ISPDataCallback pPagingCallback, ISPDataCallback pPagingPrevCallback, ISPDataCallback pFilterLinkCallback, ISPDataCallback pSchemaCallback, ISPDataCallback pRowCountCallback, Boolean& pbMaximalView) at Microsoft.SharePoint.SPListItemCollection.EnsureListItemsData() at Microsoft.SharePoint.SPFieldCollection.PopulateReturnedFieldsSafeArray() at Microsoft.SharePoint.SPFieldCollection.EnsureFieldsSafeArray(Boolean bGetFullXML) at Microsoft.SharePoint.SPFieldCollection.get_Count() at Microsoft.SharePoint.SPFieldCollection.get_Item(Int32 iIndex) at AZ.SharePoint.RST.AddUsersFromExcelUtility.RSTArchiveSetArea.RSTArchiveSetAreaUserControl.b__0()}

I have tried creating a custom view with columns getting added one-by-one but it did not work out as well for finding the column with the issue. And also have tried adding the column with internal name for referring the CAML query filter but after that too the query does not fetch the required results.

2
can you show us the actual CAML query you used?Life is good

2 Answers

1
votes

That error message typically means that there is something wrong with the syntax of your CAML query.

  • CAML can be sensitive to character casing. Try changing Type='LOOKUP' to Type='Lookup'
  • Make sure that the value of jTitleMappingList.Fields["SET Area"].InternalName resolves to the actual internal name of one of the fields on your list
  • Make sure that the column you are filtering against is actually a Lookup column, and not some other column type
0
votes

well not sure how you constructed your query, but here's a small example of how it should be :

query.Query = "<Where><Eq><FieldRef Name='SharePointFielName' /><Value Type='Text'>" + ddlSubsite.SelectedValue +</Value></Eq></Where>";

This link might help you better understand;

https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.list.getitems(v=office.14).aspx