imageThis seams to be a common problem, and one that I get many calls from users about:

I have a query with our Sharepoint site and was advised that you were probably the best person to ask.

I have created a list under:

http://sharepoint/sites/department/Lists/ListName/AllItems.aspx

I need the first column (Issue ID) to be an automatically generated number but can’t seem to get it.  Would it be possible for you to take a look and advise?

 

You can’t add a new unique auto-generated ID to a SharePoint list, but there already is one there! If you edit the “All Items” view you will see a list of columns that do not have the display option checked.

There are quite a few of these columns that exist but that are never displayed, like “Created By” and “Created”. These fields are used within SharePoint, but they are not displayed by default so as not to clutter up the display. You can’t edit these fields, but you can display them to the user. if you check the “Display” box beside the ID field you will get a unique and auto-generated ID field displayed in your list.

 

 

Technorati Tags:     
Tagged with:  
Share →
  • Mark

    Hello,

    Is it possible to display this ID when viewing the item? I hav added this id to the lit view however it would be handy when I printed the item to have the id printed with the page.

    Thanks,
    Mark

  • Martin Hinshelwood

    If you use Microsoft Office Sharepoint Designer to edit the aspx page that displays the item manualy to achieve this. What might be better though, because when you edit the page it stays edited and does not dynamicaly add fields, you could create a print page that has the desired fields and add a button outside of the form to view that page :)

    For all options you would need the Sharepoint Designer though….

  • Mark

    Brilliant.

    Thanks very much.

    Mark

  • Wade

    Is this ID field unique across all sites and libraries, or just the current site?

    Thanks,

    Wade

  • Randy

    A question to add to this string… The unique List ID works well for our lists, but we cannot use that column for searches. For example, if I want to find List ID #1234 and I search 1234, nothing is returned. Is there a way to index this ID?

    Many thanks in advance,
    Randy

  • Lisa

    Thank you so much.

    This has helped out tremendously.

  • Brian

    An easier solution for adding the ID column to the View Item view can be found here: http://www.sharepointu.com/forums/t/639.aspx. I tried it and it works perfectly.

  • Deena

    I want to use the default Issue ID to create another column called Ticket which is a unique number equal to Issue ID +5000. That way I can set my starting number. Is that possible? I can’t seem to put it in the formula field for a calculated value field.

  • Taz

    One way to add a unique id to a field (column) is to use the Item Added or Item Updated Event Handler. So for example, in your ItemAdded Event Handler

    public override void ItemAdded(SPItemEventProperties properties)
    {
    properties.ListItem["Issue ID"] = int.parse(properties.ListItem["Issue ID"]) + 1

    DisableEventFiring();
    properties.ListItem.SystemUpdate(false);
    EnableEventFiring();
    }

    This code, or something simliar

  • Jagadish

    Thank you it helped me a lot.

  • Paulvarghiese

    How to display Unique id in alert message.
    because it’s only coming to display in list. not alert.

  • Anonymous

    Can anyone explain to me how the ID # works in Sharepoint 2007?  I have read many posts that say this number does not change. 
    Does a workflow reassign the ID #?  I have workflows running on the sharepoint site.  It is very important that the list items be kept in the same order as when they were originally created.  My initial image was that I could use the ID # to keep the list in order (since it wasn’t supposed to change).  Any thoughts?