Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / October 2007

Tip: Looking for answers? Try searching our database.

Unique number for Form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marc Dimmick - 01 Oct 2007 04:18 GMT
I have created a webform using Infopath 2007. I would like each form as it is
created to have a unique identifier in the file name. Can anyone indicate the
format for this file name that needs to be setup in the Submit Option -
Filename
K.Ramana Reddy(GGK Tech) - 01 Oct 2007 04:52 GMT
Hi,

Are you using code or rules to submit the form to share point?
If you use code, you can use any field in your form as fine name and Concate
Guid to that field .
Guid generates the uniquenumber for every time new form is opened.
To generate guid use System.NewGuid().

Signature

k.Ramana Reddy
http://www.GGKtech.com

> I have created a webform using Infopath 2007. I would like each form as it is
> created to have a unique identifier in the file name. Can anyone indicate the
> format for this file name that needs to be setup in the Submit Option -
> Filename
Anna Wójcik - 01 Oct 2007 22:19 GMT
To get something unique you can use time function - get the exact time
of form submition. You can use string function to truncate time format.
Another unique identifier is ID of list item, if you submit to  form
library, but you have this after it is added.

K.Ramana Reddy(GGK Tech) pisze:
> Hi,
>
[quoted text clipped - 3 lines]
> Guid generates the uniquenumber for every time new form is opened.
> To generate guid use System.NewGuid().
gurufoo - 03 Oct 2007 19:47 GMT
I can't take credit for this solution, but I can't find the site where I
found the solution again either...I'll post the basic steps for you here
though.  Though I tried to use the timestamp in my filename originally, I
found that every time I submitted the form, it created a new version (because
of the timestamp in the filename).  If you aren't submitting your form or
only saving it then the timestamp should be fine.

1) Create a Data Connection that Recieves data from the SharePoint list
you're submitting to.  You might call it <YOUR_LIST_NAME>_IDs . The only
field you need to select is the ID field.
2) In your form, create a field (I used a text box) that has a Default Value
of 'max(@ID) + 1' where @ID is the ID field from <YOUR_LIST_NAME>_IDs .
3) In your Submit Data Connection make the filename include the ID from the
field you created in step 2.

There is a resource out there that gives more detail, but this should set
you in the right direction.

> I have created a webform using Infopath 2007. I would like each form as it is
> created to have a unique identifier in the file name. Can anyone indicate the
> format for this file name that needs to be setup in the Submit Option -
> Filename
Anna Wójcik - 03 Oct 2007 22:26 GMT
What about a performance after library grows up??

gurufoo pisze:
> I can't take credit for this solution, but I can't find the site where I
> found the solution again either...I'll post the basic steps for you here
[quoted text clipped - 18 lines]
>> format for this file name that needs to be setup in the Submit Option -
>> Filename
gurufoo - 03 Oct 2007 23:37 GMT
I'm not sure I understand.  The only "extra" processing involved is an
aggregate function (count) and a simple mathmatical computation (+1).  I'm
hard pressed to believe that those two processes would hamper performace even
if there were hundreds of thousands of records.

If you meant something else, please explain as I must have misunderstood.

-James

> What about a performance after library grows up??
>
[quoted text clipped - 21 lines]
> >> format for this file name that needs to be setup in the Submit Option -
> >> Filename
Anna Wójcik - 04 Oct 2007 21:35 GMT
I mean data retrieved from the server from the data source. I noticed
that if I use 'heavy' data source - list with e.g 500 items, form is
loading much longer.

gurufoo pisze:
> I'm not sure I understand.  The only "extra" processing involved is an
> aggregate function (count) and a simple mathmatical computation (+1).  I'm
[quoted text clipped - 30 lines]
>>>> format for this file name that needs to be setup in the Submit Option -
>>>> Filename
gurufoo - 04 Oct 2007 23:00 GMT
I wish I had a definitive answer for you.  Still, I'd be very suprised if
using the count() function was causing the form to load more slowly.  

Earlier this morning I found another method of ensuring unique filenames
that doesn't rely on counting the number items in the list. There are
probably improvements to this method I came up with, but this solution is
working for me:

1) Create a text box (hidden if you like) called daFileName
2) In InfoPath 2007 go to Tools -> Form Options -> Open and Save -> Rules
and add a rule.  The rule Condition should be "if daFileName is blank" and
the action should set the value of daFileName to concat(userName(), now())  
This should create a "for sure unique" filename because the same user can't
create two forms at the same instant...unless they're a ninja 8^)

-James

> I mean data retrieved from the server from the data source. I noticed
> that if I use 'heavy' data source - list with e.g 500 items, form is
[quoted text clipped - 35 lines]
> >>>> format for this file name that needs to be setup in the Submit Option -
> >>>> Filename
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.