Mastering SharePoint

How to created Unique Field in a document library

Latest post Sat, Sep 6 2008 5:27 PM by Jose A Villalobos. 3 replies.
  • Wed, Sep 3 2008 8:36 PM

    How to created Unique Field in a document library

     

    I am building my company's cument repository and I am trying to create a unique field within my document library list called.  I would like for this field to be unique throughout all document libraries in our portal.  I have come accross one way of doing it and that is using the itemadd event handler and list hold value that is used to increment the numbers.  Is there another way of doing this.

    Filed under: , ,
  • Thu, Sep 4 2008 2:47 PM In reply to

    Re: How to created Unique Field in a document library

    Another more "compact" method I would recommend is to create a base content type from which all your document content types would derive. The base content type would contain a column field to contain the assigned counter value, and a policy. The policy contains the counter, which would be kept up to date by a simple helper routine run in the document library ItemAdded event

     

  • Thu, Sep 4 2008 3:12 PM In reply to

    Re: How to created Unique Field in a document library

     I That is a good idea. Is this a custom policy that you would use.  Can you explain a little more.

  • Sat, Sep 6 2008 5:27 PM In reply to

    Re: How to created Unique Field in a document library

     I'm thinking about a custom policy feature that inherits from IPolicyFeature. Add code to the ProcessListItem method to update the counter whenever items are added to the list. Register the policy with the global policy catalog and the base content type.

     

Page 1 of 1 (4 items) | RSS
Copyright (c) 2008 Mixon Consulting, Inc.
Powered by Community Server (Commercial Edition), by Telligent Systems