Wednesday, March 14, 2012

SharePoint 2007: message "document locked by user or checked out" when document is checked in

Today I experienced the following scenario:

SharePoint 2007 server with a standard document library without versioning and Excel 2007 files. A user could not perform any operations (edit/delete/update) on the document. SharePoint error message appear when trying to edit/delete: the documents cannot be <action> because the document is locked by another user or checked in...

The document library har no versioning activated and the status on the Excel document is NOT checked out, so I could not make the author check it in again. I suspect that a communication error between the authors PC and SharePoint broke the connection between the local copy of the document and SharePoint - thus making SharePoint document status stuck in "locked by another user"...

When opening the Library Settings - Manage Check Out Files the document was not listed there.

Several approaches to this situation:

- checking the local drafts for the user who last edited the document (he used Office 2010 with no local SharePopint drafts folder)
- try a codeplex solution to force check-in and so on

I found an easy way to resolve the deadlock...

Workaround in my case: activate versioning...

1. Open Library Settings for the library with the troublesome document - click on Versioning setting and activate Major Versions - hit OK


2. Now the document can be checked out / edited / deleted again

3. In my case I deleted the file and uploaded the original file from disk

Note: when the author of the document opened the newly uploaded document (with the same file name) he got several options - one of them was to delete a local copy - once this was done he could work with the document in Office as expected.

Thursday, March 8, 2012

SharePoint 2010 list lookup column using Site Columns function

There are several 3-party solutions for doing cross-site lookups but here are OOTB possibilities of a lookup column that can be used on a subsite if the lookup values resides in a list above the site(s) where the column will be used. This is done through Site Columns.

Example site structure:

Home site
       SubSite1
             Subsite1.1
       SubSite2

If you have list(s) in any of these subsites that needs to get values from a global list in the Home site, you can accomplish this by defining a lookup column as a Site Column in the Home site. Define your Site Column lookup to point to the source list and target column with the correct values. The Site Column will be accessable in all subsites and can be added to any list/library using the function "Add from existing site columns" in the receiving list settings.

You maintain a global list of values and the lookup column(s) is updated with changes immediately in every list the columns is being used.