Link to home
Start Free TrialLog in
Avatar of sharepointuser
sharepointuser

asked on

Retrieving the last published version using CAML

I am using a CAML query to retrieve a list of articles in a Pages library in SharePoint publishing web site. I need to retrieve all the published articles. If I use a query like
<Eq><FieldRef Name='_ModerationStatus' /><Value Type='ModStat'>Approved</Value></Eq>
then I will only get the currently published articles. But if there is a previously published version, I need to retrieve the previously published version of the article.
For example, if an article is published(then it is retrieved and is displayed) and the editor will edit the article for a minor modification, then if I put the above query, then the article is not retrived at all(and goes out from the display).
If I dont put the above query then even the draft versions are retrieved(and displayed)

Please suggest a way I can retrieve the previous published version of an article using CAML.  
ASKER CERTIFIED SOLUTION
Avatar of AlMothanaAlOmari
AlMothanaAlOmari
Flag of Jordan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial