views:

396

answers:

2

In Sharepoint MOSS multiple users can edit the same item in a sharepoint list at the same time…the first person to save their edit “wins”.

Is there a way to prevent this, to lock the list item while it is being edited?

NB: This refers to a custom list -Not a document in a document library

+1  A: 

Not possible - checkin/checkout is only supported for list items with an associated SPFile object (images, pages, documents - essentially everything that derives from SPDocumentLibrary)

-Oisin

x0n
A: 

There are a few ways to do that, all custom. As Oisin said on his post the native check-in/check-out engine needs a file associated.

Ideas:

Javascript

  • Modified EditForm.aspx file, embedded in a List Template, XmlHttpRequest checks for a "Checked-out Items List" repository, expires/remove the check after 10-20 minutes of inactivity from the user currently editing the file.

.NET

  • Event Handlers: I have not checked but the ItemUpdating Event Type could stop you from updating it if the Modified date changed since you opened the item, saying the item was modified while being edited and need to be updated (cloning the behavior of aspx/publishing pages in SharePoint)

Infopath

  • I noticed you said you dont have the enterprise version, still your users could have the InfoPath client on their machines and fill the form locally.

Now lets start the fun :)

Empty Document Template

  • You can hack your way to create a super "Add Item" button that uploads/creates a new Document Library Item with an empty document (.txt) and redirect the user directly to the Edit Properties form. I did this when I replaced the "Change Image" in the My Sites profile with a Document Library.

Word Document

  • Word 2007 can create documents similar to forms where the user can only fill the exact fields you want, so can excel (Infopath was created because users were using these programs for forms).
F.Aquino