Solved

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

Posted on 2011-03-09
15
1,713 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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 43

Expert Comment

by:zephyr_hex (Megan)
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
 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

738 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