Auto incrementing number in infopath 2007 form issues

J

Jason

I am using infopath 2007 to create a Purchase order form that is to be
published to a WSS version 3 site. I would like the user to open up a new
form, have the unique ID displayed on that form, they fill in the rest of the
information, they can then print it and submit the form back to the library.

The problem I am having is assigning a unique PO number to each form
submitted to the sharepoint library. I thought I had it going when I changed
the data binding for the PO text box to point to the PO column in the library
and then assigned the PO textbox to the default value of: "max(.) + 1" I
thought this formula would take the maximum PO number and increment it by 1.
Then when the user opens up the form, it should run the formula and give me
the next PO number.

When I publish the form and try it out, infopath opens with "NaN in the PO
text box which means invalid data.

Does anyone have any tips on a way to get this working? From a different
posting, someone suggested to create a webservice to write to a text file and
to increment the unique ID, but I do not have a clue on how to that.... I
think I'm on the right track but I am missing something obvious, Any help
would be very very appreciated!
 
C

Chas

I would also like to achive this but the links Kalyan suggested to follow
were for connection to access DBs. Is there an answer for this that
publishes to a SP doc lib not an access DB.

Regards

Chas
 
D

dp0100

I would also like to achive this but the links Kalyan suggested to follow
were forconnectionto access DBs. Is there an answer for this that
publishes to a SP doc libnotan access DB.

Regards

Chas

:







- Show quoted text -


Jason,

I'm also having the same problem but using Count(referring to the
unique id for the form on SP) to provide an id to my form.
I have two data connections in my form - one to submit data and the
other to retrieve the ID from the forms in SP.

If I have the form open in design mode - then open up a new form via
sharepoint - clicking on 'Fill Out This Form' - it works fine?
For some reason, the data connection to SP is not working if the form
is open from Sharepoint yet I have the data connection parameter set
to retrieve data everytime the form is open.

I'll definitely keep an eye on this post for an answer -


David
 
D

DanRoswell

Jason,

I'm also having the same problem but using Count(referring to the
unique id for the form on SP) to provide an id to my form.
I have two data connections in my form - one to submit data and the
other to retrieve the ID from the forms in SP.

If I have the form open in design mode - then open up a new form via
sharepoint - clicking on 'Fill Out This Form' - it works fine?
For some reason, the data connection to SP is not working if the form
is open from Sharepoint yet I have the data connection parameter set
to retrieve data everytime the form is open.

I'll definitely keep an eye on this post for an answer -

David- Hide quoted text -

- Show quoted text -

This works well:

First you need to create a data connection so you can read the ID
number from your existing SP doc lib
1. Open your form in design mode
2. Under Design Tasks - Data Source
3. Click manage data connections towards the bottom
4. Click Add -> Create a new connection to : Recieve Data
5. Choose Sharepoint Library or list
6. Type in your SP server
7. Select the document library that your documents will be published
to
8. Click the ID column
9. Finish your wizard by giving it a unique name
(SP_doclib_ID_Numbers)

Modify your control so it reads the highest ID # in your SP list, and
adds 1 for a unique PO number
1. For your control, under value click the function box, insert field
or group
2. When your "Select field or group" box comes up, change the data
source to the one you just created
3. You should see the ID field when you expand the plus signs
4. Select the ID column
5. Use the max function on it and add 1
Should look like this : max(@ID) + 1

Don't forget to have a few docs in that library before you try it out.

One downside is that if 2 people request at the same time, your PO
field won't be unique. Im trying to find a workaround that.

Hope this helps,
Dros.
 

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