InfoPath Unique ID Number - InfoPath Dev
in

InfoPath Dev

InfoPath Unique ID Number

Last post 10-05-2010 02:10 AM by duffer73. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 10-15-2008 05:31 PM

    • phamj
    • Top 500 Contributor
      Female
    • Joined on 05-23-2008
    • Australia
    • Posts 26

    InfoPath Unique ID Number

    Hi all,

    This has been a big issue that I've been having for awhile and I'm sure heaps of people have come across this same situation before. 

     I have read a few threads regarding this issue:

    http://www.infopathdev.com/forums/p/2197/19655.aspx

    http://www.infopathdev.com/forums/p/4742/18390.aspx#18390

    Quite interesting but still no solution.  I just want to know what you guys have been saving your InfoPath forms as - what unique name did you use?

    I've tried many ways... One of which is using the SharePoint ID.

    Once the form has been publish to a SharePoint library, I did a data connection back to the InfoPath form to retreive that SharePoint ID.

    And using the function max(@ID) + 1 to generate the new ID number for the next form. Success! Works okay... 

    Problem:  If the owner of the form library decides to change the default view of that form library to another view with filters/sorting etc set on the view - not all form records will be there...

    and the function max(@ID) + 1 will only grab the largest ID number within that default view but not the max of the entire form library.

    Any ideas on how I could solve this by like some how referencing the GUID of the Form Library instead? OR is there a better way to generate an ID number?

     

    Thanks in advance.

  • 10-17-2008 06:46 AM In reply to

    Re: InfoPath Unique ID Number

    The best way is to use SQL which will generate a unique sequential ID with each submit.

    In your case I would maybe have two libraries.  Have one that is hidden by obscurity and you can control the view getting changed. That should help not being dependent on the main default view.

    Or sometimes putting a date or time portion in the name could help as well.

  • 03-24-2009 08:48 AM In reply to

    Re: InfoPath Unique ID Number

    Clay Fox:

    The best way is to use SQL which will generate a unique sequential ID with each submit.

    In your case I would maybe have two libraries.  Have one that is hidden by obscurity and you can control the view getting changed. That should help not being dependent on the main default view.

    Or sometimes putting a date or time portion in the name could help as well.

     

     

    How does the ID get incremented if there are no documents going into the hidden library?

  • 03-24-2009 03:14 PM In reply to

    Re: InfoPath Unique ID Number

    Clay Fox:
    The best way is to use SQL which will generate a unique sequential ID with each submit.
    Not to hijack, but I tried this today, and an issue I ran into is the ID doesn't fully get set until you submit. In my case I had a repeating table/section with a couple fields and allowed the user to insert. I then had a button to go to a view of the item where all the fields are available. On this view I wanted to filter a repeater so that only the selected row's fields would show, but I wasn't able to use the ID because the form hadn't been submitted yet.
  • 10-05-2010 02:10 AM In reply to

    Re: InfoPath Unique ID Number

    A soluton I have used is to query the ID of the form library on submission of the form, not when opening the form.

    Setup a new Data Connection to query the form library and retrieve the ID

    On a custom Submit button set the rule to run the query using the above Data Connection, and then set an action to set a field value to the ID+1.

    The set an action to Submit the form to the library, using the field as part of the filename.

    So, even if more than one user has the form open at the same time, it WON'T retrieve the ID until the user submits (there is still the potential for users to hit submit at the same time down to the millisecond albeit slight - this can be overcome (slightly) by appending the users ID to the filename as well further reducing the risk of duplicate filenames)

Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.