Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2011-03-09
15
Medium Priority
?
2,037 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
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
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 44

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 2000 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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

Note:  There are two main ways to deploy InfoPath forms:  Server-side and directly through the SharePoint site.  Deploying a server-side InfoPath form means the form is approved by the Administrator, thus allowing greater functionality in the form. …
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

636 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