Mastering SharePoint

Primary key in SharePoint List?

Latest post Mon, Sep 22 2008 1:47 PM by Bob Mixon. 5 replies.
  • Fri, Sep 19 2008 10:22 AM

    Primary key in SharePoint List?

     Hi All,

    Is there any way in SharePoint 2007 to have a kind or primary key in list? e.g. If I want to maintain the list of people in my organization, I need to make sure that there are no duplicates.

    Is it possible using any of the SharePoint 2007 features?

    Thanks!

    Filed under:
  • Fri, Sep 19 2008 2:19 PM In reply to

    Re: Primary key in SharePoint List?

    There is a metadata column entitled "ID" in every list that is a primary key of sorts.

    Chris Poteet
    Solutions Architect
    Mixon Consulting
    Blog

  • Fri, Sep 19 2008 2:22 PM In reply to

    Re: Primary key in SharePoint List?

     I know about the ID column. But I want to have unique column e.g. EmpId column. Can I do that?

    Thanks!

  • Sat, Sep 20 2008 8:41 PM In reply to

    Re: Primary key in SharePoint List?

    Of course.

    Chris Poteet
    Solutions Architect
    Mixon Consulting
    Blog

  • Mon, Sep 22 2008 10:03 AM In reply to

    Re: Primary key in SharePoint List?

     How can I make my custom column as primary key? Please suggest Chris.

    Thanks!

  • Mon, Sep 22 2008 1:47 PM In reply to

    Re: Primary key in SharePoint List?

    Since SharePoint is a development platform, virtually anything can be accomplished.  In the case of a Employee ID column, there are a number of ways to implement this.  The simplest approach would be to create a new column for it.  However, there isn't any OOB code that will guarantee its unique.

    To guarantee its unique, you would have to write custom code.  My recommendation would be to write a custom field for this.  It could be done with a custom event handler but that would need to be wired to any list you are using the column.

     

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