Sequential Form Numbering - InfoPath Dev Sign in | Join | Help in Newbie Questions InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » Newbie Questions » Sequential Form Numbering Sequential Form Numbering Last post 01-21-2009 01:21 AM by Skarn. 13 replies. Page 1 of 1 (14 items) Sort Posts: Oldest to newest Newest to oldest Previous Next 01-31-2007 02:42 PM mbrown Joined on 01-31-2007 Posts 4 Sequential Form Numbering Reply Contact Hello!I was looking for a way to have an infopath template to replace our paper purchase orders. This way we could email purchase orders to vendors without faxing etc. The problem is we need a sequential numbering system to replace the numbering that is on the paper forms. Is there any way to do this everytime the form is used? If we are working on PO #3443 is there a way to get it to autonumber to #3444? 01-31-2007 09:32 PM In reply to K.Ramana Reddy Joined on 04-27-2005 India Posts 195 Re: Sequential Form Numbering Mark as Not AnswerMark as Answer... Reply Contact Hi Welcome to Forums,I have one question, you want increment the number every time new form is opened or existing form(already submitted form) is opened?Thanks. K.Ramana Reddy / http://www.ggktech.comIndia. 02-01-2007 06:53 AM In reply to Matt Faus Joined on 08-18-2006 Dallas, Texas Posts 1,558 Re: Sequential Form Numbering Mark as Not AnswerMark as Answer... Reply Contact Hi Matt Brown,What you're going to have to do here is have either a datbase or an XML document available over the network that stores the previously used number. Then, each time the PO form is opened it will lock the DB/XMLdoc, increment the number by 1, and then use it in the form. I think the easiest method to set this up would be a DB. Actually, now that I think about it an XML document might not work at all because the client cannot save into it, unless you did some tricky thing where one of the 2DS was the actual XML doc to save on the network share, but then your form would probably have to be FT and that's bad. Anyway, I'm rambling - I hope this helps! Matt Faus / Microsoft InfoPath MVPQdabra® Software / Streamline data gathering to turn process into knowledge 02-01-2007 12:13 PM In reply to mbrown Joined on 01-31-2007 Posts 4 Re: Sequential Form Numbering Mark as Not AnswerMark as Answer... Reply Contact quote:Originally posted by K.Ramana ReddyHi Welcome to Forums,I have one question, you want increment the number every time new form is opened or existing form(already submitted form) is opened?Thanks.I want the increment when the form is opened for in house use. We would simply fill it out and email it to the vendor. The vrndor would have no knowledge or need of it. Our paper POs are numbered by a manually by a printing press. It's tough to go digital with your form if you can't number it for archiving purposes.Thank You for your reply. Any help you can ive on this is greatly appeciated. 02-01-2007 12:16 PM In reply to mbrown Joined on 01-31-2007 Posts 4 Re: Sequential Form Numbering Mark as Not AnswerMark as Answer... Reply Contact quote:Originally posted by Matt FausHi Matt Brown,What you're going to have to do here is have either a datbase or an XML document available over the network that stores the previously used number. Then, each time the PO form is opened it will lock the DB/XMLdoc, increment the number by 1, and then use it in the form. I think the easiest method to set this up would be a DB. OK. this sounds exactly like what I need to do. Where do I start.quote:Originally posted by Matt Faus Actually, now that I think about it an XML document might not work at all because the client cannot save into it, unless you did some tricky thing where one of the 2DS was the actual XML doc to save on the network share, but then your form would probably have to be FT and that's bad. So if an XML doc won't work than an infopath form can't do this?Thanks for your help. I really hope I can get this taken care of. 02-08-2007 02:56 PM In reply to mbrown Joined on 01-31-2007 Posts 4 Re: Sequential Form Numbering Mark as Not AnswerMark as Answer... Reply Contact Has anyone had any other thoughts on this? 02-15-2007 12:01 PM In reply to Matt Faus Joined on 08-18-2006 Dallas, Texas Posts 1,558 Re: Sequential Form Numbering Mark as Not AnswerMark as Answer... Reply Contact I think the only way to do this is to use a web service as submitting back to a database requires that you derive the Main DOM schema from the database. So, you'll create a web service with one method GetNumber() and this web service will use a data store( XML or database) to keep track of the current number to be used, and then increment this by one each time the method is called. Matt Faus / Microsoft InfoPath MVPQdabra® Software / Streamline data gathering to turn process into knowledge 05-07-2007 04:16 PM In reply to Terry G Phillips Joined on 05-07-2007 Posts 3 Re: Sequential Form Numbering Mark as Not AnswerMark as Answer... Reply Contact This may be too late , but if it helps someone else:My project is much like yours, except I have a need to send my data to a SQL db in addition to a SPList. During the form load even, I populate a hidden field with a GUID.Upon a coded submit, If my:requestID is null, I'll call a webservice to perform a db insert with basic header info, myGUID, myRequestDate, myRequestorID. The stored proc has an additional update statement that writes a formulated form name based on an identity column in the table. This is followed by a db select statement, based on myGUID that returns the requestID (identity column) and the formulated form name. This puts me in control of the form name. The default "Save" and "Save As" buttons have been hidden.And finally, a coded SharePoint submit utilizing the read-only field with the calculated name as a source for the file name.In a nutshell, I'm using SQL to handle auto-generated naming, just another way to code a cat...Terry 11-19-2008 06:53 AM In reply to mattb Joined on 05-20-2008 Posts 15 Re: Sequential Form Numbering Mark as Not AnswerMark as Answer... Reply Contact I have a very similar question. I have an InfoPath 2003 form which submits to a Sharepoint form library. I have a unique form number that uses a data connection to count the number of forms in the destination library and increments by one... concat(Year, "-", Timing, "-", count(@ID) + 1). What I'm trying to solve is how to make this work only on new forms. I need a "new" form to input this unique form number. When an existing form is later opened again, maybe to edit or view, I need to ignore the function and retain the original unique form number in that field. Can I do this? 11-19-2008 09:06 AM In reply to Hilary Stoupa Joined on 06-20-2008 Posts 13,297 Re: Sequential Form Numbering Mark as Not AnswerMark as Answer... Reply Contact Can you add an additional data field to your form to contain the name? If so, you can use a default value on that node (deselect the update on change checkbox) to hold your name, or add an open rule to populate that field if it is blank. Hilary Stoupa 11-20-2008 05:27 PM In reply to Ted Fitch Joined on 02-27-2006 Posts 567 Re: Sequential Form Numbering Mark as Not AnswerMark as Answer... Reply Contact Matt, I have an InfoPath 2003 form which submits to a Sharepoint form library. I have a unique form number that uses a data connection to count the number of forms in the destination library and increments by one... concat(Year, "-", Timing, "-", count(@ID) + 1). What happens if someone deletes a document or documents from the SharePoint library, won't this create a duplicate ID potentially? 11-21-2008 04:40 AM In reply to Frederik Van Lierde Joined on 10-21-2008 Geneva Posts 55 Re: Sequential Form Numbering Mark as Not AnswerMark as Answer... Reply Contact Hi A customer of me hadded the same needs, so I use SharePoint Document Library to do this.You only need the new number when the new order is created for the first time.Also I wanted to offer a solution without an Extra Database or WebService or XML configuration files This my solution: - Create a Receive DataSource to the SharePoint Document Library where the orderes are saved Return only the Field ID, Don't retrieve the data automatically- The submit options, select usings Perform custom actions using Rules - First Action: Query using a data connection, select the previous created Data Connection - Second Action: Set the orderID field in the Main DataSource, value is MAX(@ID)+1 @ID is the field from the previous created datasource - Third Action: Submit form You will see that everytime you create a new order, a new number is created You have to make some changes when you need to update the form, like adding conditions to the rule when the OrderID field in the Main DataSource is not set and create a second Submit Rule saying when the OrderID Field is filled in, just submit the form I hope this can help you, without using external databases and webservices. Frederik Van Lierdehttp://www.SilverSandsAssociates.com Frederik Van LierdeBlue InfoPath Blog ¦ SilverSands Associate ¦ Do you follow me already? ¦ We work smart, not hardIf this article was helpfull, don't forget to rate it, tnx! 01-20-2009 06:02 PM In reply to samksng Joined on 01-21-2009 Melbourne, Australia Posts 1 Re: Sequential Form Numbering Mark as Not AnswerMark as Answer... Reply Contact G'day Frederik, Thanks for the info you posted here. I'm a novice in InfoPath and SharePoint, your information helped a lot. However, I am unable to work out how to set up the condition in the rule to make the first submitted form to 1 instead of NaN.I have set the condition [@ID] is blank, and the other rule with condition [@ID] is not blank. However, none of the rule executed when submitting the very first form to the list. Any ideas?Thanks in advance. Regards, Mr NgMelbourne, Australia 01-21-2009 01:21 AM In reply to Skarn Joined on 04-20-2008 Australia Posts 198 Re: Sequential Form Numbering Mark as Not AnswerMark as Answer... Reply Contact Is it suitable for you to use a date-time stamp? It's just an idea I've thought of. Some things: 1. If only you needs to know the 'reference' id of your order, then you can simply put a default now() value into a field - sometimes I change this to be when the user submits - this gives you a date time stamp to use which also you can use to know the order of forms you've received. 2. If you need to display the reference for an end-user to quote, and don't want it obvious it's a datetimestamp, you could try something like having a simple function to convert the date-timestamp value into letters, like 20090124112415 (which is 24/01/2009 at 11:24:15) you could break into pairs 20 09 01 24 11 24 15 and substitute letters of the alphabet e.g. 1=A, 2=B and for 27-31 you could start using numbers again ie. 27 = 1, 28=2. This will then give you a 'reference code' for every form that you can 'reverse/decode' back into a time stamp - which would then be able to be sorted for all the forms you have had submitted. I suppose this wouldn't tell you when/if there are forms 'in between' that are 'missing', but it meets some of your requirements without being obvious it's a data-timestamp to the end user. There might even be a far more elegant way to 'disguise' the date-timestamp but I didn't research that at all. 3. If you need to have the resultant form file have the reference in it's filename, put the encoded value/field as part of the form file name in the submit rule. It's probably not ideal to have 7 characters as a reference when a single incrementing number would do, but you can do all this without any external webservices etc. and a couple of string manipulating functions to convert the timestamps back and forth wherever you need to. Page 1 of 1 (14 items) Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.
quote:Originally posted by K.Ramana ReddyHi Welcome to Forums,I have one question, you want increment the number every time new form is opened or existing form(already submitted form) is opened?Thanks.
quote:Originally posted by Matt FausHi Matt Brown,What you're going to have to do here is have either a datbase or an XML document available over the network that stores the previously used number. Then, each time the PO form is opened it will lock the DB/XMLdoc, increment the number by 1, and then use it in the form. I think the easiest method to set this up would be a DB.
quote:Originally posted by Matt Faus Actually, now that I think about it an XML document might not work at all because the client cannot save into it, unless you did some tricky thing where one of the 2DS was the actual XML doc to save on the network share, but then your form would probably have to be FT and that's bad.
This may be too late , but if it helps someone else:
My project is much like yours, except I have a need to send my data to a SQL db in addition to a SPList. During the form load even, I populate a hidden field with a GUID.
Upon a coded submit, If my:requestID is null, I'll call a webservice to perform a db insert with basic header info, myGUID, myRequestDate, myRequestorID. The stored proc has an additional update statement that writes a formulated form name based on an identity column in the table.
And finally, a coded SharePoint submit utilizing the read-only field with the calculated name as a source for the file name.
In a nutshell, I'm using SQL to handle auto-generated naming, just another way to code a cat...
Terry
I have a very similar question.
I have an InfoPath 2003 form which submits to a Sharepoint form library. I have a unique form number that uses a data connection to count the number of forms in the destination library and increments by one... concat(Year, "-", Timing, "-", count(@ID) + 1).
What I'm trying to solve is how to make this work only on new forms. I need a "new" form to input this unique form number. When an existing form is later opened again, maybe to edit or view, I need to ignore the function and retain the original unique form number in that field.
Can I do this?
Can you add an additional data field to your form to contain the name? If so, you can use a default value on that node (deselect the update on change checkbox) to hold your name, or add an open rule to populate that field if it is blank.
Matt,
What happens if someone deletes a document or documents from the SharePoint library, won't this create a duplicate ID potentially?
Hi
A customer of me hadded the same needs, so I use SharePoint Document Library to do this.You only need the new number when the new order is created for the first time.Also I wanted to offer a solution without an Extra Database or WebService or XML configuration files
This my solution:
- Create a Receive DataSource to the SharePoint Document Library where the orderes are saved Return only the Field ID, Don't retrieve the data automatically- The submit options, select usings Perform custom actions using Rules - First Action: Query using a data connection, select the previous created Data Connection - Second Action: Set the orderID field in the Main DataSource, value is MAX(@ID)+1 @ID is the field from the previous created datasource - Third Action: Submit form
You will see that everytime you create a new order, a new number is created
You have to make some changes when you need to update the form, like adding conditions to the rule when the OrderID field in the Main DataSource is not set and create a second Submit Rule saying when the OrderID Field is filled in, just submit the form
I hope this can help you, without using external databases and webservices.
Frederik Van Lierdehttp://www.SilverSandsAssociates.com
G'day Frederik,
Thanks for the info you posted here. I'm a novice in InfoPath and SharePoint, your information helped a lot.
However, I am unable to work out how to set up the condition in the rule to make the first submitted form to 1 instead of NaN.
I have set the condition [@ID] is blank, and the other rule with condition [@ID] is not blank. However, none of the rule executed when submitting the very first form to the list. Any ideas?
Thanks in advance.
Regards,
Is it suitable for you to use a date-time stamp? It's just an idea I've thought of.
Some things:
1. If only you needs to know the 'reference' id of your order, then you can simply put a default now() value into a field - sometimes I change this to be when the user submits - this gives you a date time stamp to use which also you can use to know the order of forms you've received.
2. If you need to display the reference for an end-user to quote, and don't want it obvious it's a datetimestamp, you could try something like having a simple function to convert the date-timestamp value into letters, like 20090124112415 (which is 24/01/2009 at 11:24:15) you could break into pairs 20 09 01 24 11 24 15 and substitute letters of the alphabet e.g. 1=A, 2=B and for 27-31 you could start using numbers again ie. 27 = 1, 28=2.
This will then give you a 'reference code' for every form that you can 'reverse/decode' back into a time stamp - which would then be able to be sorted for all the forms you have had submitted.
I suppose this wouldn't tell you when/if there are forms 'in between' that are 'missing', but it meets some of your requirements without being obvious it's a data-timestamp to the end user.
There might even be a far more elegant way to 'disguise' the date-timestamp but I didn't research that at all.
3. If you need to have the resultant form file have the reference in it's filename, put the encoded value/field as part of the form file name in the submit rule.
It's probably not ideal to have 7 characters as a reference when a single incrementing number would do, but you can do all this without any external webservices etc. and a couple of string manipulating functions to convert the timestamps back and forth wherever you need to.