Tuesday, July 23, 2013

SharePoint 2007 Easy Method to Generate CAML Queries

CAML is an XML based language which can be used to query SharePoint lists and libraries. Being XML based it is not the easiest language to write queries in, and business rules/logic can make for some complex statements.
However there is a simple method for generating the CAML.
  1. Create a view on the list/library you wish to query that will display the result set you want returned.
  2. Load up SharePoint Manager 2007 on the SharePoint server.
  3. Using the tree view on the side of SP Manager find the list/library you are querying (under the correct web) and expand the available views.
  4. Click on the relevant view, the right hand window will show the various properties. The Query property will contain the CAML query for that view.

No comments:

Post a Comment