how do I automatically sequence numbers on forms in infopath

S

Sam

How do I sequentially number Infopath forms when they are opened from a
Sharepoint site?
 
G

Gavin McKay

Hello,

By "open" do you mean they already exist? If so, you would need to add some
sort of library event or process that would go through the existing forms and
change the name to add your sequential number.

If the forms haven't been created yet (i.e. new form being saved to the
library) you will need to control the "Submit" process programmatically and
set the sequential number via code. i.e. in your custom "Submit" code you
would allocate the sequential number based on "something" like date/time or
from a database or (at a pinch) the count of the items in the library +1
(though this doesn't work if you are deleting items!). That way you control
the name of the form as it gets saved into the library.

I have code floating around somewhere to do that, I'll see if I can dig it
up...

HTH

Gavin.
 
G

Gavin McKay

Hello,

(writing this the second time because I got timed out grrrr :)

If you mean the forms already exist in an sharepoint library, then you would
need to write some sort of library event or process that would automatically
rename the files based on some sequencing algorithm you write. Check
"Sharepoint library events" for information on writing the former, the latter
would be Sharepoint object model.

If you mean the forms would be new ones saved to the library, then you may
have to write code to submit based on your own requirements. For example,
create your own submit function that would automatically set the name of the
form based on some sequential number algorithm as above. This could be based
on the date/time, number supplied by database, even the count of items in the
list (though this doesn't work if you are deleting items from the same list!)

HTH

Gavin.
 

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