开发者

CAML Query Documents for Workflows

开发者 https://www.devze.com 2022-12-11 19:17 出处:网络
I\'m usi开发者_JAVA百科ng Sharepoint 2007. Is there a way to CAML query documents (in this example with a ContentType of Invoice) that do not have any workflows assigned to them?

I'm usi开发者_JAVA百科ng Sharepoint 2007. Is there a way to CAML query documents (in this example with a ContentType of Invoice) that do not have any workflows assigned to them?

I realize I can pull back all of the Invoices using something like this:

       SPQuery query = new SPQuery();
        query.ViewAttributes = "Scope=\"RecursiveAll\"";
        query.Query= @"<OrderBy>
   <FieldRef Name=""Title"" />
</OrderBy>
<Where>
   <Eq>
      <FieldRef Name=""ContentType"" />
      <Value Type=""Text"">Invoice</Value>
   </Eq>
</Where>";

    SPList list = web.GetList(url);
    SPListItemCollection items = list.GetItems(query);

and then access each indivdual SPListItem Workflows collection, and check to see if the collection is null or has a count of 0.

However, I don't want to pull back 100,000+ invoices when I only need the 50 or so that don't have workflows.

So, I'm looking for a CAML query that allows me to get Invoices without workflows.

Thanks!

Dave


Have a look at the Stramit CAML Viewer on codeplex I have found it very useful in designing CAML querys in the past. It will allow you to develop CAML querys againt sharepoint 2007 as well as list all the available fields that you could query against.

0

精彩评论

暂无评论...
验证码 换一张
取 消