JasonD
JasonD

Reputation: 45

Sharepoint CAML query to search folder on ID field

Using CAML in WSS3, I am trying to search for a folder by the folder ID field. This results in 'undefined' when searching the 'Folder' content type but works fine searching for a regular item.

Here is a snippet of my code:

<Query><Where><Eq><FieldRef Name='ID'/><Value type='Integer'>"+folderIDtoFind+"</Value></Eq></Where></Query>
...
<QueryOptions><ViewAttributes Scope='Recursive' /></QueryOptions>

Any suggestions for how I can find folders by their id's?

Upvotes: 3

Views: 31989

Answers (1)

Nat
Nat

Reputation: 14305

Try

<Query><Where><Eq><FieldRef Name='ID'/><Value type='Counter'>"+folderIDtoFind+"</Value></Eq></Where></Query> 

Also, grab a copy of A CAML builder tool...

Upvotes: 3

Related Questions