Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Caml query on ContentTypeId

$
0
0

I have a strange issue that I would appreciate some help with. I am basically running an SPSiteDataQuery with query.Webs = @"<Webs Scope='SiteCollection'/>";

The query is below and you will see that I am searching for any results where the ContentTypeId (in my ViewFields collection I retrieve the ContentType field) is one of my three custom content types. I successfully retrieve the query, convert it to a datatable and set the latter as the DataSource of a Telerik RadGrid.

All works very well. And the column in my grid named Content Type displays the values for the ContentType ViewField retrieved. e.g. MyCtype1, MyCtype2 etc.

The odd thing is this. Suddenly that column will stop displaying these values and every row in that column will show "Pages".

Can anybody shed any light on this please?

                    query.Query = @"<Where><Eq><FieldRef Name='Status'/><Value Type='Choice'>Archived</Value></Eq><And>    <Or><BeginsWith><FieldRef Name='ContentTypeId'/><Value Type='ContentTypeId'>0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900d1464232f9d743c3825bbea8b7a1480d</Value></BeginsWith><BeginsWith><FieldRef Name='ContentTypeId'/><Value Type='ContentTypeId'>0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900fe1da98183534357823f6c65aceb07f0</Value></BeginsWith><BeginsWith><FieldRef Name='ContentTypeId'/><Value Type='ContentTypeId'>0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900863EDDEFC76E4EEB9329E14385C8FB01</Value></BeginsWith></Or></And></Where>";




Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>