DyslexicDev (Martin Hinshelwood's Blog)

A Scottish dyslexic software developer: Team System MVP, .NET architect, developer, evangelist, technology enthusiast and multi-dimensional free thinker
posts - 391, comments - 517, trackbacks - 57

My Links

News

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.




TwitterCounter for @hinshelm



Locations of visitors to this page

Subscribe

Personal

Twitter












Tag Cloud

Article Categories

Archives

Post Categories

Image Galleries

Blogs I read

Blogs of Friends

Multi-Dimentional Free Thinking Bloggers

Personal

Projects

VSTS

Unique ID in SharePoint list

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.

 

 

Print | posted on Friday, January 11, 2008 8:44 AM | Filed Under [ Sharepoint Answers ]

Feedback

Gravatar

# re: Unique ID in SharePoint list

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
1/13/2008 10:48 AM | Mark
Gravatar

# re: Unique ID in SharePoint list

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....
1/13/2008 3:25 PM | Martin Hinshelwood
Gravatar

# re: Unique ID in SharePoint list

Brilliant.

Thanks very much.

Mark
1/13/2008 10:23 PM | Mark
Gravatar

# re: Unique ID in SharePoint list

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

Thanks,

Wade
1/29/2008 5:15 PM | Wade
Gravatar

# re: Unique ID in SharePoint list

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
1/29/2008 8:01 PM | Randy
Gravatar

# re: Unique ID in SharePoint list

Thank you so much.

This has helped out tremendously.
1/30/2008 2:32 PM | Lisa
Gravatar

# re: Unique ID in SharePoint list

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.
4/8/2008 5:15 PM | Brian
Gravatar

# re: Unique ID in SharePoint list

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.
5/7/2008 8:29 PM | Deena
Gravatar

# re: Unique ID in SharePoint list

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
5/13/2008 4:52 AM | Taz
Gravatar

# re: Unique ID in SharePoint list

Thank you it helped me a lot.
6/18/2008 3:35 AM | Jagadish
Gravatar

# re: Unique ID in SharePoint list

How to display Unique id in alert message.
because it's only coming to display in list. not alert.
10/26/2008 5:57 AM | Paulvarghiese
Comments have been closed on this topic.

Powered by: