Unique ID Generation - InfoPath Dev
in

InfoPath Dev

Unique ID Generation

Last post 12-31-2008 03:41 AM by kalaicompute. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 11-11-2008 05:15 AM

    Unique ID Generation

    hi, 

    I am a new to this site & Infopath.

    I have a lib in which i submit my forms and send the view of the form in mail like with my subject as  concat("ABC","-",max(@ID))

    Now if my lib. is empty it shows NaN in my subject were i am including the ID.how do u take care of it. 

    And if i have say 10 files in my lib. and i delete the 10 file, then the id also get altered for the next form which is submitted(say i del my 10 file and now add 11 one, now the Id in my mail subject is the previous one which is already deleted.)

    So how can u create a unique id that gets incremented by itself when my lib is empty and also retains the value irrespective of anyone deleting the forms.

  • 12-05-2008 08:13 AM In reply to

    Just thinking out loud here, I thought of a messy way in which I would accomplish this (and this is by no means Ideal but I think it will accomplish your goal)

    -Add a new field in your form called form number

    - Republish your form making sure that the form number collumn is promoted and that it is editable outside the form.

    -Set your Document library as a data source

    -Save a place holder document and filter it out of all views

    -Now in the form set the default value of Form Number to max(@Form Number)

    (Here is where it gets painfully convoluted and messy)

    -Write a SharePoint Designer workflow which will Update the Placeholder Documents form number with max(@Form Number)+1 whenever a item is created in the list.

     There are too many moving parts to this solution and I really don't suggest it if there is a lot of traffic with this document library but hopefully you'll be able to glean some ideas from this.

    ~*"Logic is the cement of our civilization, with which we ascend from chaos, using reason as our guide" - T'Plana-Hath, Matron of Vulcan Philosophy *~
  • 12-08-2008 06:01 AM In reply to

    Hi

    Add a submit button to the page
    Select to use Action: Rules and Custom Code
    Add 3 Actions:

     1. Action Query using a dataconnection to get the new number
     2. Set the ID textbox to 1 if previous action returns Nan (Using Set Condition)
     3. Action: Submit using a dataconnection to submit the form

    Frederik Van Lierde

    Frederik Van Lierde
    Blue InfoPath Blog  ¦  SilverSands Associate  ¦  Do you follow me already?  ¦  We work smart, not hard


    If this article was helpfull, don't forget to rate it, tnx!
  • 12-31-2008 03:41 AM In reply to

    I guess it will help you. http://bladah.com/?p=51
    Kalai
    http://www.ilink-systems.com
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.