Hi,
I am trying to query the pages library. I have used the below code:
using (SPSite oSite = new SPSite(SiteName)) { using (SPWeb oWeb = oSite.OpenWeb()) { SPList lstPages = oWeb.Lists["Pages"]; SPQuery sQuery = new SPQuery(); sQuery.Query = "<Where><And><And><And>" +"<Contains><FieldRef Name='PublishingPageLayout' /><Value Type='URL'>TS_TestPageLayout.aspx</Value></Contains></And>" + "<Eq><FieldRef Name='_ModerationStatus' /><Value Type='ModStat'>0</Value></Eq></And>" +"<Eq><FieldRef Name=\"_Level\" /><Value Type=\"Integer\">1</Value></Eq>" +"</And></Where>"; SPListItemCollection myColl = lstPages.GetItems(sQuery); } }
I have tried modifying the query to have "_ModerationStatus" and "_Level". But still the same error.
I know that SPQuery requires internal names, and I hope I have given the same.
I am getting error as "One or more field types are not installed properly"
How to fix this?
Thanks