Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I want to be able to generate serial numbers for use in (for example) uniquely identifying list items. The serial numbers all need to be unique, and preferably monotonically increasing (0001, 0002, 0004 etc).

In SharePoint Standard I could create a database which I poll for a serial number, update it and then return the result. Another (better?) option is to create a Windows Service on the server which is polled as a Web Service and keeps track of and returns the required number. However, none of these solutions are possible in SharePoint Online.

I could set up a web service on a separate server, but I'd ideally want something that's self-contained. It is important that the serial numbers are unique even if there are concurrent requests to the number service.

Any ideas?

share|improve this question
add comment

3 Answers

up vote 2 down vote accepted

Every list comes with the ID column that does exactly this.

share|improve this answer
2  
And to think I've been working with SharePoint for a year and didn't remember this feature... The ID column might be the right choice, although it is specific to each list and hence can't be used site-globally. Might use a calculated column based on ID. Thanks. –  Geir Smestad Apr 25 '12 at 12:56
add comment

If the items are Documents you could try the Document ID Service feature (see Site Collection Features)

share|improve this answer
add comment

If the ID column does not meet your needs...

Without knowing exactly what the requirements are for generating the numbers it is hard to give you concrete advice. But you could have a SharePoint list that has a column for the numbers that have been allocated, you would then select the highest number from the list and increment it by one. You would, of course, need to write some sort of logic to ensure that if there were two requests at the same time it did not submit the same value. So you would need the field to enforce unique values and your application that would give out the numbers would need to take that error condition into account. But if you are only uniquely identifying the list item, that is in fact what the ID column is for a theChrisKent pointed out.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.