Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

SPQuery error -One or more field types are not installed properly

$
0
0

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



Viewing all articles
Browse latest Browse all 7589

Trending Articles



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