caml

CAML query to locate specific SPFolder nested in document library tree

It seems like searching with CAML and SPQuery doesn't work properly against custom metadata, when searching for SPFolders instead of files, or when searching for custom content types. I've been using U2U to test a variety of queries, and just not getting anywhere. The doc's aren't very complete on the topic, and google isn't helping ei...

CAML query items with the given URLs

In SP2007/MOSS I need to run a CAML query against a single list like so: <Where> <Or> <Eq> <FieldRef Name='URL' /> <Value Type='URL'>/path/item1.aspx</Value> </Eq> <Eq> <FieldRef Name='URL' /> <Value Type='URL'>/path/item4.aspx</Value> </Eq> <Eq>...

CAML to HTML

I'm invoking one of SharePoint's web service APIs that returns a CAML fragment. I've searched the interweb far and wide but I've been unable to figure out how to make this CAML fragment to render as "normal" HTML that I can render in a more sane environment like Plumtree, WLP, Liferay or any other portal besides SharePoint. Without a wa...

SPCrossListQuery fails to bring back results

I am calling SPWeb.GetSiteData(anSpCrossListQuery). It fails to bring back any results or any errors when I call it with an accidental space at the end of the CAML query <Where></Where> clause. Anyone have an idea why? ...

Sharepoint Lists - GroupBy?

Hello, I'm trying to get data from a Sharepoint list and put it into some Flex graphs. I can call the list data just fine using a CAML query, but I want to use a GroupBy to consolidate the rows by Teams. So, for example Team 1 may have 20 records, Team 2 may have 8 records, and Team 3 might have 25 records... Instead of showing 53 rec...

CAML queries: how to filter folders from result set?

Hi all, I'm using caml query to select all documents which were modified or added by user. Query runs recursively on all subsites of specified site collection. Now problem is I can't get rid of folders which are also part of result set. For now I'm filtering them from result datatable. But I'm wondering: Is it possible to filter out fol...

"does not contain" in CAML ?

Hallo, in CAML i can query SharePoint Listitems using the "Contains"-element - but there is no "does not contain"-element i could use. So what is the best way to get the items that do not contain a string? Is there a better way than to loop through each and every item? Thanks in advance! ...

IS CAML the only way to Query MOSS?

CAML is hard to learn, and dificult to use, is there a better way to get results from MOSS, besides using CAML queries? And not referring to the Web Services, which are slower, or the object model, which again is slower. ...

SharePoint A-Z groupby in CAML

Hi I'm using the content query web part and have exported it to a webpart file to allow me to change the queryoverride and groupby elements. I want to group the results alphabetically, so I thought that I can maybe use a function to grab the first letter of the title of the list items and then group by this, it might do the trick. Prob...

MAX query using CAML

I want to select a sharepoint list item which has the Maximum value for a particular column. How can I do this using CAML queries? ...

What is the best way to retrieve distinct / unique values using SPQuery?

I have a list that looks like: Movie Year ----- ---- Fight Club 1999 The Matrix 1999 Pulp Fiction 1994 Using CAML and the SPQuery object I need to get a distinct list of items from the Year column which will populate a drop down control. Searching around there doesn't appear to be a way of doing this withi...

Good beginning CAML tutorials?

Hi there, right now I'm trying to get CAML down pat in SharePoint, where is the best place to start for this? The MSDN content doesn't impress me much as being somewhat cryptic, though the Wikipedia entry was rather good for starting out. Thoughts? Thanks! EDIT: Everyone below has great links, but alas I can only pick one answer... ...

CAML Query not ordering properly

Can anyone help me with this CAML query? When I flip the Ascending attribute from TRUE to FALSE (have also tried True and False), it doesn't re-order the result set. The rest of the CAML is correct, it is being generated by a tool and the appropriate results are being returned. <Where> <And> <And> <Eq> <FieldRef ...

Disabling default XML Schemas in Visual Studio?

I have recently started using CAML.NET IntelliSense for SharePoint with Visual Studio 2008; which works great; however whenever I create a new project using STSDev 2008 (and thus generate feature.xml and WebParts.xml) the default schemas include the CAML.NET IntelliSense and the built-in (relatively incomplete) schemas: caml.xsd wss.xs...

How to get in CAML (Sharepoint 2007) the same results as SPNavigation.QuickLaunch?

I have a website in Sharepoint. To get a list of sites ordered by the exploration, that is to say, ordered by the user in the sharepoint administration, i would write the following code: SPWeb web = CurrentSite.OpenWeb(currentSite); SPNavigation nav = web.Navigation; SPNavigationNodeCollection nodeColl = nav.QuickLaunch; That is o...

Ceiling function in SharePoint CAML query

I am trying to create a custom view for a sharepoint list, similar to the one explained here: http://msdn.microsoft.com/en-us/library/ms916812.aspx I have a column which is a number field with values ranging from 0 to 100. I need to create a view style which will display an image in the column based on the column value, instead of dis...

Sharepoint List added to Create -> Custom Lists on Feature deployment.

I am building a SharePoint Feature to deploy a simple WebPart and a custom list within the "Web" scope. When the solution is deployed my list is immediately available in Site Actions -> Site Settings -> Custom Lists. If you try and create an instance of the list I receive "File Not Found" If you activate the feature a second copy of th...

CAML to show only Sites in Sharepoint 2007

I need to view only the available sites defining a CAML-structure view in the Content and Structure Reports webpart. I've tried using both Stramit Caml Viewer and U2U Caml Query Builder 2007 but they doesn't seem to support the objects I wan't to show (sites and subsites). ...

SharePoint 2007 Publishing site and Audience Targeting in Web Part

In a Publishing site I have web part that has to show news items from the list that has Audience Targeting field. I am using CAML query to retrieve small number of last news items. Is it possible to specify Target Audience in the CAML query ? If not, how should I do it ? Retrieve all results and than apply filter in a loop ? I am p...

Querying List Data From SharePoint Web Services

Has anybody ever successfully written code to extract data from a SharePoint 2007 list (specifically, an InfoPath form library) using the GetListItems() method in the http:///_vti_bin/lists.asmx service (and lived to tell about it)? It returns some of the worst XML I've seen in my life (it's not even compliant XML). Is there some easy w...