Search by Custom Types
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Content Management Server > Search by Custom Types




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Search by Custom Types  
Achuss AKA JapiJavi


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-12-07 12:16 PM

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."}






[ Post a follow-up to this message ]



    Re: Search by Custom Types  
Achuss AKA JapiJavi


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
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 ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:25 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register