工作流程的 CAML 查询文档
我正在使用 Sharepoint 2007。是否有一种方法可以 CAML 查询没有分配任何工作流程的文档(在此示例中,内容类型为发票)?
我意识到我可以使用如下方式拉回所有发票:
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);
然后访问每个单独的 SPListItem Workflows 集合,并检查该集合是否为空或计数为 0。
但是,我不想拉回100,000 多张发票,而我只需要 50 张左右且没有工作流程的发票。
因此,我正在寻找一个 CAML 查询,它允许我无需工作流程即可获取发票。
谢谢!
戴夫
I'm using 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看看 codeplex 上的 Stramit CAML Viewer 我发现它在设计 CAML 查询时非常有用过去的。它将允许您针对 sharepoint 2007 开发 CAML 查询,并列出您可以查询的所有可用字段。
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.