Solved

How to Create an custom Auto-Incrementing Number Field in sharepoint

Posted on 2011-03-09
15
1,602 Views
Last Modified: 2012-05-11
How to Create an custom Auto-Incrementing Number Field in sharepoint without any .net coding and not that the auto generated in build feature in sharepoint because it has problem likes (sharepoint has a built-in ID field that is auto incrementing.The user cannot change it, it starts from one and goes up, and if you delete an item (say #4) there will never be another with the same ID (say #4).)
0
Comment
Question by:neenavishwakarma
15 Comments
 

Author Comment

by:neenavishwakarma
ID: 35085148
need answer ASAP.
thanks
0
 
LVL 14

Expert Comment

by:KoenVosters
ID: 35085232
It is not possible if you are not using custom coding. If that is your requirement then it pretty much isn't possible.
0
 

Author Comment

by:neenavishwakarma
ID: 35085324
i want to generate one tag number column like GPZ0001,GPZ0002,GPZ0003....so on upto GPZ9999.. Let me know the solution,i saw somewhere custom Auto-Incrementing Number Field is possible with creating workflow also...can anyone tell me how to do with that and any other solution... i can generate GPZ1,GPZ2 with the existing feature (GPZ&ID) but not GPZ0001,GPZ0002 and so on .... and also i want if I delete an item (say #4) there will be another with the same ID (say #4).
0
 
LVL 8

Expert Comment

by:nsyyoung
ID: 35086062
Will calculated columns work?  

One column with the string "GPZ" as its only value, not included in any views.  Another column with the number to start with: ".0001" (trim the . from the number using the substring-after function - I don't think SharePoint will keep the starting zeros).  Another column adding .0001 to the starting number.

Concatenate GPZ and substring-after([incremented column],1,4) (check that - I'm not looking at the formulas now).  You should end up with GPZ0001.

Do you want another ID of 4 if the item with ID of 4 is deleted?  You can't have that, but you could replace item GPZ0004, just be aware that if anything else is pointing at that deleted item using its ID, that item won't be pointing at anything if that ID's item gets deleted.

0
 
LVL 42

Expert Comment

by:zephyr_hex
ID: 35087244
KoenVosters is correct.
0
 

Author Comment

by:neenavishwakarma
ID: 35087286
no actually, calculated columns is not working with ID column well it coming but again its disappear while adding or editing new row...so it wont work.
I searched on google the same problem can be solve throught creating a workflow on sharepoint.I am new to workflow....dont know how to utilise workflow for this problem solution.
Can anyone tell me step-by-step how to create unique ID (like also GPZ1/GPZ0001) through workflow in sharepoint.
Thanks
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Author Comment

by:neenavishwakarma
ID: 35087315
no actually, calculated columns is not working with ID column well it coming but again its disappear while adding or editing new row...so it wont work.
I searched on google the same problem can be solve throught creating a workflow on sharepoint.I am new to workflow....dont know how to utilise workflow for this problem solution.
Can anyone tell me step-by-step how to create unique ID (like also GPZ1/GPZ0001) through workflow in sharepoint.
Note::: My client is not allowing for any custom coding in sharepoint,i have to use existing sharepoint feature to find the solution and build my requirement.
Thanks
0
 
LVL 15

Expert Comment

by:dp_expert
ID: 35094912
Hello

You have 2 options:
- create a workflow that will do the incrementation - this workflow would run when you create new item, check on some other list what is the max ID, add 1 to it and put the value into the new item and to the other list.
- use a custom column from these guys - http://www.infowisesolutions.com/product.aspx?id=SmartIDPro
0
 
LVL 15

Expert Comment

by:dp_expert
ID: 35095056
The steps for the workflow:
- create a custom list called "global variables". In the "Title" column you will keep the next ID. Create a calculated column named "Full number". The calculated column should have the following formula ="GPZ"&IF(LEN(Title)=1,"000",IF(LEN(Title)=2,"00",IF(LEN(Title)=3,"0","")))&Title - this will ensure that you will have the correct number of 0s and will add the "GPZ" at the beggining
- create a workflow that will run on the item start
- add  update current item activity that will edit the current item and set the id to the value of the "Full number" column from the item from the "Global variables" where the id>0 (this list will contain only one item, so you can put any condition that will retunr this item)
- add "Calculate" activity and add "1" to the "TItle" column of the item from the "GLobal variables" - store the value in some variable
- add edit item actitivy that will edit the item on the "GLobal variables" and set the "Title" to the value of the variable from the previous point.

One remark - if two people add an item at the same time you can experience getting the same number for those items. You can add a condition that will search for an item with the same id and if is found then modify your ID the same way as before.
0
 
LVL 15

Accepted Solution

by:
dp_expert earned 500 total points
ID: 35096719
Also this solution would allow you to have the custom identifier and reuse the deleted idenitfiers http://store.bamboosolutions.com/sharepoint-custom-unique-identifier.aspx
0
 

Author Comment

by:neenavishwakarma
ID: 35096852
thanks for the reply but your mention site ,its seems to be in SP2010 but i am using SP 2007,Well i will try the previous solu mention above and let u know guys if its works for me through workflow idea..
thanks
0
 
LVL 15

Expert Comment

by:dp_expert
ID: 35096882
It will work both on 2007 and 2010
0
 

Author Comment

by:neenavishwakarma
ID: 35234275
ok i will try this thanks fr the solution
0

Featured Post

Don't lose your head updating email signatures!

Do your end users still have the wrong email signature? Do email signature updates bore you or fill you with a sense of dread? You can make this a whole lot easier on yourself by trusting an Exclaimer email signature management solution. Over 50 million users do...so should you!

Join & Write a Comment

The vision: A MegaMenu for a SharePoint portal home page The mission: Make it easy to maintain. Allow rich content and sub headers as well as standard links. Factor in frequent changes without involving developers or a lengthy Dev/Test/Prod rel…
Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
This video discusses moving either the default database or any database to a new volume.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now