CAMLQuery: Recursive, but without Folder Names

May 31, 2012 at 11:17 AM
Edited May 31, 2012 at 11:18 AM

Hey, ive got a second question, but i dont know where the problem ist.

Im using SPCascadeDropdowns and the Script is getting the Child and Parent Entries from another list.

Iam using this:

CAMLQueryOptions: "<QueryOptions><ViewAttributes Scope='RecursiveAll'/></QueryOptions>"

 

for getting everything in this list within the folders, but now i get the folder names too, so i added a CAMLQuery:

<Neq><FieldRef Name='FSObjType' /> <Value Type='Integer'>1</Value></Neq> 

And i already tried this version:

   <Neq><FieldRef Name='ContenType' /> <Value Type='Text'>Folder</Value></Neq> 

And my whole CAMLQuery looks like this:

   

<Query>
	<OrderBy>
		<FieldRef Name ='Title'/>
	</OrderBy>
	<Where>
		<And>
			<And>
				<Eq>
					<FieldRef Name='Brand'/>
						<Value Type='Text'>
						</Value>
				</Eq>
				<Neq>
					<FieldRef Name='ContentType' />
					<Value Type='Text'>
						Folder
					</Value>
				</Neq>
			</And>
			<IsNotNull>
				<FieldRef Name='Title' />
			</IsNotNull>
		</And>
	</Where>
</Query>

But its not working at all, everytime he shows me the folder names..

Thanks for your help!

Coordinator
May 31, 2012 at 11:52 AM
Edited May 31, 2012 at 11:56 AM

Marcel:

Did you try this?

<Eq><FieldRef Name='FSObjType' /><Value Type='Lookup'>0</Value></Eq>

or conversely:

<Neq><FieldRef Name='FSObjType' /><Value Type='Lookup'>1</Value></Neq>

M.

May 31, 2012 at 11:59 AM

Tanks for your answer, first i didnt try this both versions, but they aren't working either.

 

 

Am i getting this right, because my collegue said at opening the site the list items (parent and child) are fetched without the SpService Javascript. But this cant be true, right? Because then Recursive wouldn't work at opening, either?

Coordinator
May 31, 2012 at 12:39 PM

I'm not sure I understand...

M.

May 31, 2012 at 12:42 PM

When loading the page, in my example some formular which uses spservices CascadeDropdowns, the parent and the child dropdowns are filled with the results from camlquery, not with some sharepoint services themself, right? So i should change the CamlQuery to get the results i want ( ex. Recursive), and without the folder names in this dropdown menu..

 

Coordinator
May 31, 2012 at 12:51 PM

I totally missed that you said SPCascadeDropdowns above; I thought you were working with GetListItems. Can you post back your entire call so that I can see what you are doing?

If you are using SPCascadeDropdowns, then that's a different thing. How that works is that the page loads just as it normally would without the script, and all dropdowns have all available values. Then the script runs and pares down the options based on the settings you've provided in the function call(s).

M.