Showing posts with label autonaming. Show all posts
Showing posts with label autonaming. Show all posts

Tuesday, March 3, 2009

Auto-naming custom list definition

There are so many times where companies want to standardize their file naming process across document libraries. In order to achieve that, in a Sharepoint document library, you can use a couple of ways, workflow or custom list definition with event receivers.

I have created and uploaded a custom list definition, which saves files by using the following naming rule: 3 first uppercase letters of content type + REF + DOCID. For example a document of content type Correspondence with ID=33 will be named CORREF33.

The event receivers are fired up on the following events: ItemCreated, ItemUpdated, ItemCheckedIn. In all cases, if the content type is or inherited by the content type “folder”, the naming conversion is not taking place. If you have enabled the “Require documents to be checked out before they can be edited” option, the ItemCreated and ItemUpdated event receivers are not evaluated in order to avoid conflicts and items are named after you checked them in.

In order to install the custom list definition, extract the archive somewhere in your Sharepoint Server and execute “setup.bat /i /weburl http://mysite/myweb”. You should now be able to select the “Autonaming Document Library” when you try to create a new list or document library.

http://rapidshare.com/files/204782843/AutonamingListDef.zip.html