Unique number in text string field - InfoPath Dev
in

InfoPath Dev

Unique number in text string field

Last post 02-18-2007 11:59 AM by marinaNZ. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 02-13-2007 07:46 PM

    Unique number in text string field

    Is there a function that I can run in a text string field that will be automatically populated every time a new form from a template is created? Ideally it would be a number picked from the form last created using this template (if it's of any help - the form is stored on the SharePoint site)

    cheers!
  • 02-13-2007 09:08 PM In reply to

    Re: Unique number in text string field

    Hi,

    Check out this link, it may be helpful for you,
    http://infopathdev.com/forums/topic.asp?TOPIC_ID=2964

    Thanks.
    K.Ramana Reddy / http://www.ggktech.com
    India.
  • 02-14-2007 12:00 PM In reply to

    Re: Unique number in text string field

    Sorry, I may not have described properly what i'm trying to achieve. there's a field that i would like to autopopulate every time a new form is opened from a template. the value that I would like to have in the field is e.g "PC-" and a number that would be +1 from the field previously populated in the form that was last created in the library. Or the other option is to apply some logic for generating the number, the important thing is that the number is unique, i.e. it does not duplicate any other ones that were generated before.

    Thanks again!
  • 02-14-2007 10:11 PM In reply to

    Re: Unique number in text string field

    Hello

    Why Dont You try using a GUID to be unique to each form created?
    Kalyan G Reddy
    Infopath MVP 2007 and 2008
  • 02-14-2007 10:36 PM In reply to

    Re: Unique number in text string field

    Hi,

    You can create a GUID and Concate that GUID to any text you want(Ex:PC+GUID) and assign the value to the field you want show in the infopath form.

    Formula for Generating GUID:System.Guid.NewGuid();

    I hope this will help for you.

    Thanks.
    K.Ramana Reddy / http://www.ggktech.com
    India.
  • 02-15-2007 10:58 PM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Unique number in text string field

    Hi MarinaNZ,

    Check out these links,

    http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=639

    http://www.infopathdev.com/howto/tutorials/default.aspx?i=5eb5c19c1e2747bc965fe1720534d8dd
  • 02-18-2007 11:59 AM In reply to

    Re: Unique number in text string field

    Thanks everyone! Seems like i've found the solution - the alternative to the suggestions you posted above. This is what i did and it looks like it's working:
    1 - promoted the unique code (e.g product number) as a column to the Sharepoint library
    2 - added this library as a data connection
    3 - set up the field value using the 'max' formula that retrieves the biggest number in the product code column in the Sharepoint form library '+1'. (the formula in the end looks like this: "max(@PC) + 1"

    I was just playing with the formula and didn't expect it to work without having a 'sum' function, but looks lilke it does!

    Thanks for the references to the other topics - i'll find them useful in other scenarios, i'm sure.

    Cheers
    Marina

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