Interviews5 answers
Q. What is query.ViewAttributes OR How can you force SPQuery to return results from all the folders of the list?
5 Answers
query.ViewAttributes="Scope=\"RecursiveAll\"
Venkatareddy AnnapareddyPosted Jan 22, 2018, 2:19 AM EST
ViewAttributes is used to define scope to return items.
if query.ViewAttributes="Scope=\"Recursive\" then it will return all items within folder and subfolder excluding folder, it will exclude folder but can retrieve items from that folder
if query.ViewAttributes="Scope=\"RecursiveAll\" then it will return all items within folder and subfolder including folders
Suchitra BeheraPosted Dec 7, 2015, 10:05 PM EST
spquery.viewatributes="scope="/recursive/""
sudi kumariPosted Sep 1, 2015, 4:29 AM EDT
Hello. you need to specify the scope under ViewAttributes of query. ex query.ViewAttributes="Scope=\"Recursive\"";
Ashish MatePosted Aug 25, 2015, 9:28 PM EDT
If you use SPQuery on any SPlist .. it will bring back results from the current folder only.
If you want to get results from all the folders in the list.. then you need to specify the scope of the query
by the use of ViewAttributes..
e.g. query.ViewAttributes = "Scope=\"Recursive\"";
Sagar PardeshiPosted Nov 26, 2014, 9:15 PM EST


