locked
Is there a way of locating files that are checked out to you RRS feed

  • Question

  • Hi,

    Today I was presented with this scenario. If someone uploads multiple files across multiple document libraries and perhaps dosnt add properties and check in 3. Is there a way for that person at the end of the day to click a button and be presented with any files that are checked out to him at that moment.

    I thought this would be a fairly obvious feature however I cannot see this option anywhere. Am I just being thick or is SharePoint coming up short ?

    Thanks


    • Edited by Mike Walsh FIN Tuesday, September 6, 2011 3:00 PM "yet again" removed. Unnecessary flame
    • Moved by Mike Walsh FIN Tuesday, September 6, 2011 3:00 PM not general (From:SharePoint - General Question and Answers and Discussion (pre-SharePoint 2010))
    Tuesday, September 6, 2011 2:25 PM

Answers

  • Hi,

    Yes this can be done by querying the required lists and libraries to find the files that are checked out only to you.

    Please refer this thread where one is able to see all the checked out and pending files by using SPQuery on targeted libraries or lists.

    http://social.msdn.microsoft.com/Forums/en/sharepointdevelopment/thread/166bc79e-f9ad-428d-be6a-6574e7c23414

    you just need to query the "checked out to" User field and check that If thats you then do the needed report generation.

    Here is the sample code 

     

    using (SPSite site = new SPSite("http://yoursite"))
                    {
                        using (SPWeb web = site.OpenWeb())
                        {

    string _currentUser = web.CurrentUser.Name;
                            SPList _list = web.Lists["YourList"];
                            if (_list != null)
                            {
                                SPQuery _query = new SPQuery();
                                _query.Query = "<Where><Contains><FieldRef Name='CheckoutUser' /><Value Type='User'>" + _currentUser + "</Value></Contains></Where>";
                                SPListItemCollection _items = _list.GetItems(_query);
                                if (_items != null && _items.Count > 0)
                                {
                                    foreach (SPListItem _item in _items)
                                    {
                                        //Add Item Details to your Report
                                    }
                                }
                            }
                        }
                    }

     

     

    hope this helps you


    Bhushan | http://www.passionatetechie.blogspot.com | http://twitter.com/BhushanGawale

    Tuesday, September 6, 2011 3:10 PM
  • Hi,

    There is no way to do it directly as per your requirement. You can do it easily via custom code however.

    If you still want to go for in built way then go to document library settings and click on manage checked out files.

    Here you will get all checked out files enlisted. If you want to check them all at one shot then open the document library in site manager and select all checked out file by you and click on check in under actions.

    I hope this will help you out.


    Thanks, Rahul Rashu
    Friday, September 9, 2011 2:28 AM

All replies

  • You can check the "Checked out files" by navigating to Document library - Settings - Document library settings - Manage Checked out files , This option will show all the checkedout files in the library.

    Hope this helps.


    Thanks & Regards Posting is provided "AS IS" with no warranties, and confers no rights.
    • Edited by Zoeb S Tuesday, September 6, 2011 3:02 PM
    Tuesday, September 6, 2011 3:01 PM
  • Hi,

    Yes this can be done by querying the required lists and libraries to find the files that are checked out only to you.

    Please refer this thread where one is able to see all the checked out and pending files by using SPQuery on targeted libraries or lists.

    http://social.msdn.microsoft.com/Forums/en/sharepointdevelopment/thread/166bc79e-f9ad-428d-be6a-6574e7c23414

    you just need to query the "checked out to" User field and check that If thats you then do the needed report generation.

    Here is the sample code 

     

    using (SPSite site = new SPSite("http://yoursite"))
                    {
                        using (SPWeb web = site.OpenWeb())
                        {

    string _currentUser = web.CurrentUser.Name;
                            SPList _list = web.Lists["YourList"];
                            if (_list != null)
                            {
                                SPQuery _query = new SPQuery();
                                _query.Query = "<Where><Contains><FieldRef Name='CheckoutUser' /><Value Type='User'>" + _currentUser + "</Value></Contains></Where>";
                                SPListItemCollection _items = _list.GetItems(_query);
                                if (_items != null && _items.Count > 0)
                                {
                                    foreach (SPListItem _item in _items)
                                    {
                                        //Add Item Details to your Report
                                    }
                                }
                            }
                        }
                    }

     

     

    hope this helps you


    Bhushan | http://www.passionatetechie.blogspot.com | http://twitter.com/BhushanGawale

    Tuesday, September 6, 2011 3:10 PM
  • Hi,

    There is no way to do it directly as per your requirement. You can do it easily via custom code however.

    If you still want to go for in built way then go to document library settings and click on manage checked out files.

    Here you will get all checked out files enlisted. If you want to check them all at one shot then open the document library in site manager and select all checked out file by you and click on check in under actions.

    I hope this will help you out.


    Thanks, Rahul Rashu
    Friday, September 9, 2011 2:28 AM