AUTONUMBERING IN INFOPATH

G

Gene Griffe

I have created our Purchase Request from in InfoPath and need to have the
Requisition Number be automatically generated each time the form is opened.
Is there an easier way than creating a database just for the Requisition
Number? Any assistance would be greatly appreciated.

Gene
 
J

Josh Bertsch [MSFT]

Without the number being generated from a web service or a database, the
number isn't guarenteed to be unique. You can probably come close, but it
won't be guarenteed.

If you aren't requring uniqueness, there are a number of ways to generate
almost random numbers. However, there is no real way within the bounds of
the current form to create an incrementing number. For that you would have
to, as you say, use a database or a web service.

--josh bertsch
 
J

Jerry Thomas [MSFT]

Another way to have the number generated, but not sequential, is to use a
combination of date and time and employee ID. (Employee initials might be
duplicated)

If you need sequential, you don't have to use a database. You can accomplish
this with just a seperate XML form that only has the counter. Using code,
you can get the value and then increment it each time. This is a lot more
involved as you have to code retries if the file is locked.



--
Jerry Thomas[MSFT]
<[email protected]>
Microsoft Office InfoPath
---------------------------------------
This posting is provided "As Is" with no warranties, and confers no rights.
Use of any included script sample are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.
Please do not send email directly to this alias. This alias is for
newsgroup purposes only.
 
N

NikV

Jerry;
I am interested in generating a number using the time, date as you indicated
in your previous response to this question. How would you accomplish this?
By coding? If coding is use, please explain in VB. Thanks!

Jerry Thomas said:
Another way to have the number generated, but not sequential, is to use a
combination of date and time and employee ID. (Employee initials might be
duplicated)

If you need sequential, you don't have to use a database. You can accomplish
this with just a seperate XML form that only has the counter. Using code,
you can get the value and then increment it each time. This is a lot more
involved as you have to code retries if the file is locked.



--
Jerry Thomas[MSFT]
<[email protected]>
Microsoft Office InfoPath
---------------------------------------
This posting is provided "As Is" with no warranties, and confers no rights.
Use of any included script sample are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.
Please do not send email directly to this alias. This alias is for
newsgroup purposes only.


Gene Griffe said:
I have created our Purchase Request from in InfoPath and need to have the
Requisition Number be automatically generated each time the form is opened.
Is there an easier way than creating a database just for the Requisition
Number? Any assistance would be greatly appreciated.

Gene
 
S

Sean N

Create a new Data Connection to Receive Data

Point it to the specific library that you will be submitting data to..

Uncheck default selected fields and only select/Check ID
Uncheck Store a copy of the data in the form template
Uncheck Automatically retrieve data when form is opened

Go to Submit Options and
Allow users to submit this form
and
Perform custom action using Rules
Add the following Actions
Query using a data connect: Receive Auto Number
Set a fields value: AutoNumber = max(@ID) +1
Submit using a data connection: Submit

Now, each time you submit to the library, filename will be autogenerated.

Hope this helps,

Regards,
Sean
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top