Martin Hinshelwood's Blog

A Scottish dyslexic software developer: .NET architect, developer, evangelist, technology enthusiast and multi-dimensional free thinker


News

Disclaimer

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

Subscribe

Personal

Accreditation

Stats

My Stats

  • Posts - 255
  • Comments - 283
  • Trackbacks - 67

Twitter












Tag Cloud


Recent Comments


Recent Posts


Article Categories


Archives


Post Categories


Image Galleries


Blogs I read


Blogs of Friends


Blogs on VSTS


Multi-Dimentional Free Thinking Bloggers


Personal


Projects



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.

 


posted @ Friday, January 11, 2008 8:44 AM | Filed Under [ Sharepoint Work ]

Comments

Gravatar # re: Unique ID in SharePoint list
Posted by Mark on 1/13/2008 10:48 AM
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
Gravatar # re: Unique ID in SharePoint list
Posted by Martin Hinshelwood on 1/13/2008 3:25 PM
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....
Gravatar # re: Unique ID in SharePoint list
Posted by Mark on 1/13/2008 10:23 PM
Brilliant.

Thanks very much.

Mark
Gravatar # re: Unique ID in SharePoint list
Posted by Wade on 1/29/2008 5:15 PM
Is this ID field unique across all sites and libraries, or just the current site?

Thanks,

Wade
Gravatar # re: Unique ID in SharePoint list
Posted by Randy on 1/29/2008 8:01 PM
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
Gravatar # re: Unique ID in SharePoint list
Posted by Lisa on 1/30/2008 2:32 PM
Thank you so much.

This has helped out tremendously.
Gravatar # re: Unique ID in SharePoint list
Posted by Brian on 4/8/2008 5:15 PM
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.
Gravatar # re: Unique ID in SharePoint list
Posted by Deena on 5/7/2008 8:29 PM
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.
Gravatar # re: Unique ID in SharePoint list
Posted by Taz on 5/13/2008 4:52 AM
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
Gravatar # re: Unique ID in SharePoint list
Posted by Jagadish on 6/18/2008 3:35 AM
Thank you it helped me a lot.
Post a comment





 

Please add 5 and 2 and type the answer here: