What is Check Out?The Check Out operation creates a lock on the document preventing changes by other users. Check Out allows saving multiple times without changing the version. Other users can still access a Read-Only copy of the document.The Version is changed as part of the Check In operation.What is Check In?The Check In operation releases the lock on the document. Now other user can save their changes to the document.Version ImpactThe following is the depiction of the impact on a document for Check In / Check Out operations:PracticeTo start with we need to create a Document Library named Version Docs.We need to enable Versioning for this document library. You can do this through the Library Settings > Versioning Settings link. The types of versions available are:
A pictorial of Major & Minor parts are shown below:For the time being choose Major versions (second item) and click the OK button. We can see that the version number is changed during the Check In operation.Note: Please use Internet Explorer 32-bit for working with this example. The recommended Microsoft Office version would be 2010.UploadNow we can upload a Word Document into the library. Use the Add document link to upload a document. Make sure you have the content of the file as Initial Content.After uploading the document you can view the version number using the context menu item.Click on the Version History item to view the version associated.You can see that the version number says as 1.0 for the newly uploaded document.Check OutFor checking out the document choose the Check Out option from the document context menu.You should be prompted with the following dialog box:The dialog box asks whether to:
Click the OK button to continue with check out. Modify the file by adding some text to it as shown below.You can click the Save button of the Microsoft Word Application to save the changes to your local drafts / server drafts location. These changes won't be visible to other users reading the same document.Local Drafts FolderThe local drafts folder is a client side folder where the checked out file is copied. Local Drafts Folder enables the user to check out the document, disconnect from the network, work offline on the document, connect back to the network, and check in the document.You can find the Local Drafts Folder in:OS Drive > Current User > Documents > SharePoint Drafts For example in my Windows 7 machine the location is shown below. (Depending on the operating system the local drafts folder location changes.)In short the advantages of the Local Drafts folder are Speed & Portability.Check InNow we can proceed with Check In operation. Through the check in operation the changes made to the document are saved in the server. Any users accessing the document should receive the updated content after the Check In.For checking in, choose the Check In Operation from the context menu. A dialog box will be prompted with additional options. Click the OK button in the dialog box that appears.After the Check In operation the Document Icon should change to:From the previous icon shown below:You can verify the Version History after the Check In operation.The new Version 2.0 is shown there.Note: A new version is created only when the user checks in the document. Checking out to a local drafts folder makes it convenient to work on the file when your computer is away from the network.Discard Check OutAfter a Check Out operation the user can either:
The Discard Check Out operation can be done through the context menu of the document item.Possible ErrorsYou may encounter the following error while working with Check Out / Check In operations.Error: The file XXX is checked out or locked for editing by YYYIn my real world experience I have seen this error occurs with many customers. SolutionThe solution which worked here is to use the Manage files which have no checked in version option from the Library Settings.In the page that appears you can select the file and click the Take ownership of Selection option.Referenceshttp://tinyurl.com/sp2010-docverSummaryIn this article we have explored the Version Impact on the Check In and Check Out operations and viewing the associated Version History.To summarize, the following are the points we have learned:
Jean Paul is a Developer plus Architect working on Microsoft Technologies for the past 12 years. He is very much passionate in programming and his core skills are SharePoint, ASP.NET & C#.
C# Corner. All contents are copyright of their authors.