1
在执行SPSiteDataQuery
的SharePoint 2007中,筛选器的内容类型按预期工作。SPSiteDataQuery:在SharePoint 2010中筛选内容类型
<Where>
<Eq>
<FieldRef Name='ContentType'/>
<Value Type='Text'>SomeContentType</Value>
</Eq>
</Where>
在SharePoint 2010中,相同的查询仅从一个列表返回项目。 可能的解决方法是过滤内容类型标识。 A“BeginsWith”运营商必须使用,因为“列表内容类型”,从“网站内容类型”继承:
<Where>
<BeginsWith>
<FieldRef Name='ContentTypeID'/>
<Value Type='Text'>SomeContentTypeId</Value>
</BeginsWith>
</Where>
但是这会匹配所有项目与此内容类型或任何继承的内容类型。这不是我想要的。
有谁知道如何用内容类型过滤器创建SPSiteDataQuery
?
我喜欢能够选择所有继承的内容类型的美女。为什么你使用'BeginsWith'来选择ID,而不是你可以选择特定的内容类型,甚至是'EndsWith'?! – 2012-01-09 16:26:33
CAML中没有'EndsWith'元素,是吗? – Stefan 2012-01-09 17:15:30
你说得对,对不起。但是'Contains'确实存在。 – 2012-01-09 20:38:21