• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2117
  • Last Modified:

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

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
neenavishwakarma
Asked:
neenavishwakarma
1 Solution
 
neenavishwakarmaAuthor Commented:
need answer ASAP.
thanks
0
 
KoenVostersCommented:
It is not possible if you are not using custom coding. If that is your requirement then it pretty much isn't possible.
0
 
neenavishwakarmaAuthor Commented:
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
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.

 
nsyyoungCommented:
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
 
zephyr_hex (Megan)DeveloperCommented:
KoenVosters is correct.
0
 
neenavishwakarmaAuthor Commented:
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
 
neenavishwakarmaAuthor Commented:
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
 
dp_expertCommented:
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
 
dp_expertCommented:
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
 
dp_expertCommented:
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
 
neenavishwakarmaAuthor Commented:
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
 
dp_expertCommented:
It will work both on 2007 and 2010
0
 
neenavishwakarmaAuthor Commented:
ok i will try this thanks fr the solution
0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now