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

Using Moderation Status in SPQuery

$
0
0

Hello all. I'm attempting to create an SPQuery object that queries a list for items with an Approval Status of Pending. I've tried several queries but all result in SPExceptions that state 'Cannot complete this action' when I attempt to loop the items.

Here's what I've tried:

qry.Query = "<Where><Eq><FieldRef Name='_ModerationStatus'/><Value Type='ModStat'>2</Value></Eq></Where>";

qry.Query = "<Where><Eq><FieldRef Name='_ModerationStatus'/><Value Type='ModStat'>Pending</Value></Eq></Where>";

qry.Query = "<Where><Eq><FieldRef Name='_ModerationStatus'/><Value Type='Text'>Pending</Value></Eq></Where>";

qry.Query = "<Where><Eq><FieldRef Name='_ModerationStatus'/><Value Type='Number'>2</Value></Eq></Where>";

I've had no success with any of them but I'm pretty sure the top one should work. Any ideas?


Lester Sconyers


Viewing all articles
Browse latest Browse all 25064

Trending Articles



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