Auto ID - InfoPath Dev
in

InfoPath Dev

Auto ID

Last post 02-25-2009 07:20 AM by imran. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 02-24-2009 08:48 AM

    • imran
    • Not Ranked
    • Joined on 02-24-2009
    • Posts 7

    Auto ID

    I developed InfoPath 2007 form and published in SharePoint form library. My problem is how I can achieve, every time when I open a new form from MOSS 2007 from library, the form ID text box should get unique ID automatically.

    Please help. Thank you so much for your time

     

  • 02-24-2009 05:59 PM In reply to

    Hi, welcome! 

    Since you have MOSS, you must have a SQL db hanging about somewhere -- you could try this technique from my blog....In my blog, I get the ID in the save event, but you could use it in the Loading event just as easily....

    Hilary Stoupa

  • 02-24-2009 06:13 PM In reply to

    Hi Imran and welcome ot our forum,

    Simple Codeless Solution: let ShP or SQL do the job for you. Kind of a hack, but it works.... 

    Over the years, this has been a very common request. You should search our forum for "Auto ID SharePoint". To reuse the SharePoint ID without writing code, you'll have to do two submits. First, submit to SharePoint and then query SharePoint for the form you Submitted (making sure to include the ID column in the data returned). The query will return a list of items from the SharePoint list and you can then filter this to find the one submitted and copy the ID out and into your main data source (using a rule). Then, let your user fill out the form and perform the final submit. One issue is comparing the file. How do you do this? Well, you can use a hidden field which is set to the username concatenated with the date/time of the first submit. So, you'll need to set this field before the first submit and use it in the query to get the ID back. This isn't totally bulletproof, btu the chance of the same user doing two submits in the same millisecond are, for all intents and purposes, nil. The other issue with this approach is what to do if the user decides not to submit it - well, then you have these zombie files in your SharePoint library. To identify these so you can filter them out (and later delete them), you can just set another hidden field to "Draft" on open. So first submitted form has the value "Draft" for that field. Then, on final submit, the rule should change that field to "Final" (or, whatever). You can then filter your ShP list to only show the Final forms.

    What about if there are thousands of forms in the SharePoint form library? Good point! Well, you should archive old forms (and filter them out so they don't show on your default ShP view) or move the data into SQL and use SQL to do the same thing. We provide a Query Web Service (called qWSSP) that does filtered querying of ShP and SQL so that all of the data is not copied to the client, just the data you want. That speeds it up considerably: check out the performance data.

    More Complex Solution: use code and GUIDs to do it... (the avove should work, but another approach is to use code and GUIDs - see Hilary's comment! :) )

    Patrick Halstead
    Project Manager at Qdabra
  • 02-25-2009 07:20 AM In reply to

    • imran
    • Not Ranked
    • Joined on 02-24-2009
    • Posts 7

    thanks for helping me

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