07-12-07 12:16 PM
On 12 jul, 12:36, Achuss AKA JapiJavi <ach...@gmail.com> wrote:
> Hi all!
> I've got a MultiColumn Custom Type Field and I'm trying to search for
> items inside the list it's contained.
> Basicaly, my multicolumn field holds two columns: one for Category and
> another one for Capabilities (similiar to the Country/City relations).
> For example, I have stored: Usa as country and LA, Chicago and New
> York as cities.
>
> Now, I'm coding a search page using the SPList object, GetItems
> method, passing as a parameter the query inside a SPQuery object:
>
> SPQuery spQuery;
> SPListItemCollection spQueryResults;
> SPList myTestList = myTestWeb.Lists["Agencies"];
>
> string agencyQuery = "<Where><Contains><FieldRef Name='Cat-
> Cap1'/><Value Type='Text'>Design</Value></Contains></Where>";
>
> spQuery = new SPQuery();
> spQuery.Query = agencyQuery;
> spQueryResults = myTestList.GetItems(spQuery);
>
> "Cat-Cap1' is the name of the column I added of type
> "CategoryCapability" type.
> "CategoryCapability" is the Custom Type control I created.
>
> Performing this query I don't get any error, the error is raised when
> trying to access the results. This is the message:
> {"One or more field types are not installed properly. Go to the list
> settings page to delete these fields."}
Hi all again!
I've already solved my problem.
My problem was the configuration of the XML tag with the type of the
field.
This is the solution:
<Where><Contains><FieldRef Name='Cat_x002d_Cap1'/><Value
Type='CategoryCapability'>Design</Value></Contains></Where>
I had 2 problems:
I had to translate Cat-Cap1 into Cat_x002d_Cap1 (more XML friendly :P)
I had to place the correct type of the field. Instead of "Text" I've
placed 'CategoryCapability'
[ Post a follow-up to this message ]
|