in

InfoPath Dev

Unique form number/name generation?

Last post 10-28-2008 05:36 PM by bladah29. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 06-18-2007 11:03 PM

    • Jeff.Wang
    • Top 500 Contributor
      Male
    • Joined on 06-19-2007
    • Sydney, Australia
    • Posts 13

    Unique form number/name generation?

    I am submitting InfoPath forms into MOSS2007, and this needs generating a unique form name (XXX.xml) each time, is there any solution we can avoid web service and database? Better to figure out within InfoPath or MOSS.

     Jeff.

    Jeff Wang
    Sydney Australia.
  • 06-18-2007 11:56 PM In reply to

    Re: Unique form number/name generation?

    Hi Jeff, 

    You can do this without code.  One way I have done this within InfoPath is to concenate a unique name by using:

    the user alias of the person submitting the form, data from one required field in the form, and then the now() function that returns the current date/time in ISO format.  This should give you a unuqie name that would be very hard to duplicate.

    Hope that helps

    Ted Fitch / Project Manager
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 06-19-2007 05:31 PM In reply to

    • Jeff.Wang
    • Top 500 Contributor
      Male
    • Joined on 06-19-2007
    • Sydney, Australia
    • Posts 13

    Re: Unique form number/name generation?

    Thanks a lot Ted, this definitely will be one of my options, but is there any way to have a predefinable string format setup? e.g. I need the form name like "JSA-001" or something based on a serial number, instead of a date/time based string?

    Jeff Wang
    Sydney Australia.
  • 01-23-2008 06:24 PM In reply to

    Re: Unique form number/name generation?

    Ted Fitch:

    Hi Jeff, 

    You can do this without code.  One way I have done this within InfoPath is to concenate a unique name by using:

    the user alias of the person submitting the form, data from one required field in the form, and then the now() function that returns the current date/time in ISO format.  This should give you a unuqie name that would be very hard to duplicate.

    Hope that helps

    Hi Ted, I tried this solution before, but it didn't work for me because every time a user edits the form from within SharePoint, a new form filename gets generated, so when they resubmit the edited form, a new record is added to the SharePoint list. I'm struggling with the same thing: how to generate a unique form filename ONCE only when the form is initially created. Now if there was some way to reference the form file's Creation Date... Tom
  • 01-23-2008 06:56 PM In reply to

    Re: Unique form number/name generation?

    Instead of using now() each time.  Set in Open Rules if the form is new (a required field is blank or whatever) to populate a field with Now() which essentially is creationdate.

    Then use this new creationdate field in your file name and do not modify if the form is opened again.  That way your file name remains the same through out the life of the file.

    Another method would be to put a file name field in the form, use your rules to create the name if the field is blank, then use the field as the file name. That way it is created once and gets reused each time.

  • 01-23-2008 09:33 PM In reply to

    Re: Unique form number/name generation?

    Thanks for the input, Clay. This helped me resolve my problem. 8)

    Tom
  • 05-30-2008 01:11 PM In reply to

    Re: Unique form number/name generation?

    Here's an approach which avoids a specific problem. The problem: if you save your InfoPath form using a name generated from a concat of field values, then save the form, then go back and edit one of those field values, then save again, you will result in 2 files: the original (pre-edited) form and a new form with a file name reflecting the new field values. In other words, 2 forms. VERY BAD!!

    Here's the solution: simple and takes 5 minutes to implement: http://davesmossblog.blogspot.com/2008/05/how-to-submit-infopath-forms-with.html

    David Altfeder
    VP Software Development
    TROY Group Inc.
  • 10-28-2008 05:36 PM In reply to

    Re: Unique form number/name generation?

    Here's the method that I found works the easiest:

     http://bladah.com/?p=51

     The solution will allow you to generate a unique ID when the form is submitted to the library. It will also give you the capability to edit the form and re-submit without creating a new item every time it is re-submitted.

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