unique ID in infopath form. - InfoPath Dev
in

InfoPath Dev

unique ID in infopath form.

Last post 11-29-2007 05:55 PM by Patrick Halstead. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 11-28-2007 04:32 PM

    unique ID in infopath form.

    Hope all is well. I am building my first enterprise InfoPath solution with work flow and MOSS. I have a unique requirement. I am not sure how to do this. Maybe you could help me. When the form first loads we would like to give it a unique ID. The unique ID maybe something like UR2811070001. The last four digits may come from a custom sql table. When the form loads the last four digits would increment by 1. The code UR will be static and the date piece will obviously change based on the day. I was thinking of using a web service method to do the above which would concatenate the output. . Do you have any suggestions or code snippets I could use.Thank you.  
  • 11-28-2007 05:56 PM In reply to

    Re: unique ID in infopath form.

    Welcome to the forum.

    If you are going to make an enterprise solution I recommend using the Database Accelerator. Qdabra Database Accelerator Suite Version 2.1 - Developer

     

    It includes a web service for querying SQL tables plus has lots of other benefits.

  • 11-28-2007 06:11 PM In reply to

    Re: unique ID in infopath form.

    Thank you for the reply. But it does not answer my question.

  • 11-28-2007 10:56 PM In reply to

    Re: unique ID in infopath form.

    Hi InfoPathStartup and welcome to our forum!

    Clay forgot to mention that the Web service we provide (which is free for developers) actually supports exactly the functionality that you need out of the box. We call it RefID support. You can specify a static code UR followed by an xpath to a field that receives the concatenated string. The Web service controls this when you submit the form.

    The simplest solution is to increment this on submit since that's the time when the data is stored. If you try to increment this on load of the form, the user could go offline, or close the form which produces a gap in the ids or some dummy data. My recommendation would be to do this on submit. After the initial form is submit, you can refer to the ID on your form since the form is now stored in SQL or SharePoint or wherever.

    If UR doesn't change, I recommend having a field that concatenates the ID with UR on load, but only if the form is loaded from an existing location (i.e., it's not new). There is a IsNew method in the InfoPath OM that you can use. We have some code lying around that also uses SharePoint. SharePoint sits on top of SQL but limits access to the database. However, you can still get the ID from the data exposed in SharePoint. If you would like to send us a $100 support pack, we can spend an hour and dig up this code.

    Hopefully, this gave you more ideas.  If not, please reply and I'll try again. :)

     

    Patrick Halstead
    Project Manager at Qdabra
  • 11-29-2007 08:53 AM In reply to

    Re: unique ID in infopath form.

    Hi,

    I would like to stay away from third party products. My organization has a long process of approving software purchases. Any internal infopath solutions you can think of? This forum is useless if you are only using it to sell your product.

    Thanks.

  • 11-29-2007 09:08 AM In reply to

    Re: unique ID in infopath form.

    What you are describing can be done. If you want a web service, then you would either have to build it yourself or get it via an installed package.  I understand how hard it can be to get software approved and installed but either way to do what you describe you would need server access. 

    You can connect to SQL as a secondary data connection without it being a web service and might get what you need.

    Sorry we are not more help.

  • 11-29-2007 05:55 PM In reply to

    Re: unique ID in infopath form.

    Hi InfoPathStartup,

    I wasn't trying to sell our product. Sorry it came across that way. We host this forum for the community. We may recommend free tools and products from time to time because they are a much better alternative than doing it yourself. However, in this case, Clay is correct: you can do it yourself without too much trouble. I alluded to how this might be done. We're busy trying to stay in business so we can't always spend hours replying to every post. I hope you understand.

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.