R – Accessing a List on demand using SharePoint WebService

sharepointsharepoint-2007

I am able to access a Site then Lists inside the Site and then List Items inside all the Lists. This works fine when I want to crawl/access all the Items in a Site.

I am keen to know if there is a way through which we can directly access a List in a Site. To elaborate on this :: If I have 1000 sites and 1000 documents then I would have to go through 1999 items at the worst before finding the one I want.

Any help/suggestion on this would be greatly appreciated.

Thanks

Best Answer

Try using an SPSiteDataQuery to get what you need. There are many ways to develop the CAML query you want such as CAML Query Builder.

This is the best way to avoid trolling through all Webs->Lists->ListItems to find items. I prefer to limit the SPSiteDataQuery to one site collection and call the query for each site collection that is relevant as there are some limitations to the SPSiteDataQuery.

The equivalent for webservices would be the GetListItems in the SiteData webservice

Related Topic