Skip to main content

Elumenotion Blog

Go Search

 
Elumenotion > Elumenotion Blog > Posts > SharePoint Developer Productivity Tip #3 - Easy CAML Queries
SharePoint Developer Productivity Tip #3 - Easy CAML Queries

Previously, I wrote about CAML queries and the CAML Query Builder. I no longer use this tool. This is not because of any lack in the tool but rather a desire to simplify my development environment - a shift away from many specialty tools to a few generalized ones. Chief among these is SharePoint Manager 2007. In the previous productivity tip, I talked about using SPM to extract site columns for features (you can do something similar for content types with a bit more effort). This one is about CAML queries.

To get the syntax for a CAML query, I start by creating a view of the list that has the same structure as the ultimate target of the query. For example, I have a calendar, and I'd like to create a query of my upcoming (and sorely needed) vacations. I start by creating a new Calendar list to act as a prototype. Next, I create a new view with the desired set of fields and whatever sort, filter, and grouping I desire.

Once I have the view, deriving the CAML query from it with SPM is easy. I simply navigate to the view and copy the query and ViewFields from the Schema XML tab!

 

Comments

Re: SharePoint Developer Productivity Tip #3 - Easy CAML Queries

Have you used the new version of CAML Query builder?
Anon at 8/3/2009 10:08 AM

sfd

I usually start with copying the list schema feature that is closest to what I want to achieve. In this case this was the Custom List (=folder custlist) feature. I then change the IDs, Type, Titles etc. Then I test the new feature, and check if I get a new list template registered that will work.
Anon at 8/25/2009 2:48 AM

Add Comment

Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Title


Body *


Your Name *


Attachments
Follow me on twitter!
  Archive
  Archive (Calendar)
  Skinner Created Themes
  New Skinner Download
  New Skinner Tutorial

©  2009 Elumenotion, LLC  |   SharePoint Training, SharePoint Consulting and SharePoint Staffing
8075 Cavendish Place | Suwanee, Georgia 30024 | + 1 (888) 653-5021