1
votes

Name of the column in document library is : Column name => Keywords (Sub-Processes, Methodology, Servicing Model, etc) Column Type=> Multiple lines of text

We are using the above column name in the caml query as below

query.Query = "<Where><Eq><FieldRef Name='Keywords(Sub-Processes,Methodology,Servicing Model, etc)'/><Value Type='Text'>Merchant Services,Merchant Set Up</Value></Eq></Where>";

but when we run the code we get the exception:

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

Is this exception because of special characters used in the column name if yes then how can I correct it.

We can't change the column name because it is requirement.

3
I am adding code but after submitting the code it is not getting displayed :( - Rushikesh
query.Query = "<Where><Eq><FieldRef Name='Keywords_x0020_(Sub-Processes,_x0020_Methodology,_x0020_Servicing_x0020_Model,_x0020_etc)'/><Value Type='Text'>Merchant Services,Merchant Set Up</Value></Eq></Where>"; - Rushikesh
@Rushikesh are you sure fields internal name is soo long? Check With SharePoint manager to be sure. Or you can try using fields ID instead ID="{G-U-I-D}" - Janis Veinbergs

3 Answers

2
votes

Internal names and display names are quite different from each other. They can be the same in some cases but not all. There is generally an escape sequence in between two words with a space.

It is often a good practice to retrieve the internal name at runtime rather than hardcoding it.

Here's how to do it:

var internalName=list.Fields.GetFieldByInternalName(column.ColumnName).Title;
1
votes

I can tell you for sure (given the special characters) that that's not the internal name of the field. It might be the display name, but it's not the internal name.

The error is because there is no field with an internal name of what you have provided.

Personally, when I want to find the internal name of a field I go to the list settings for the list and edit the column. When doing so there will be a query parameter with 'field=' followed by the internal name. There are other places that it can be found, and other sharepoint tools (SharePoint Manager was mentioned by another poster) that can be used to get such information.

0
votes

I used "Keywords_x0020_x002f_x0020_Folksnomy" and it worked for me. I fetched all the columns of the Document library and bind it to the GridView,in GridView I found this name.

Display Column name => Keywords (Sub-Processes, Methodology, Servicing Model, etc)

Wrong one is => Keywords_x0020_(Sub-Processes,_x0020_Methodology,_x0020_Servicing_x0020_Model,_x0020_etc)

Newly found correct name is => Keywords_x0020_x002f_x0020_Folksnomy