Saturday 10 September 2011

Get all Files\Items Checked Out by current user in SharePoint


To get all the Files or items checked out to the current user you can use SPSiteDataQuery

SPSiteDataQuery q = new SPSiteDataQuery();

q.Lists = "<Lists BaseType='1'/>";

q.Query = "<Where><Geq><FieldRef Name='CheckoutUser' LookupId='TRUE'/>

<Value Type='User'>SPContext.Current.Web.CurrentUser.ID </Value></Geq></Where>";

q.Webs = "<Webs Scope='SiteCollection' />";

q.ViewFields = "<FieldRef Name='Title' /><FieldRef Name='ID' />";

q.RowLimit = 10;

The query above gives you Title and ID of all the items Checked Out to the current User.

Also See : Get all documents Checked Out to current user in Sharepoint 2010 - Out of Box

Get all Checked in, Checked Out Items in a Sharepoint site

Ads by Google

No comments:

Post a Comment