Autopopulate file name? - InfoPath Dev
in

InfoPath Dev

Autopopulate file name?

Last post 09-06-2010 08:59 AM by Hilary Stoupa. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 09-04-2010 08:16 PM

    • jyost2
    • Not Ranked
    • Joined on 09-05-2010
    • Posts 1

    Autopopulate file name?

    I have created a form in infopath for my sharepoint site. Is it possible to autopopulate a new file name everytime someone creates a new file? something simple like date and and count the number of files created that day (i.e. 09041003 for the third file created today)

    Thanks

  • 09-05-2010 03:03 PM In reply to

    Re: Autopopulate file name?

     Hi, to do that , you have to set caption property.

    -You can add a global variable: int Caption=0;

    -add an event on context change and set some code here an example :

    if(caption<1)
    {
        this.Application.ActiveWindow.Caption = "YOUR CAPTION";
        caption++;
    }

     

  • 09-06-2010 08:59 AM In reply to

    Re: Autopopulate file name?

    Hi -- my guess is that you are asking about an actual filename and not a window caption. The real problem with "count the number of files created that day" is thinking through when you make that count -- not when the form is opened, because if I open the form and get a "3" for being third, and someone else opens the form before I save mine, they will also get a "3". If you get the count RIGHT before submission, you have a better chance of not overwritting, but it would probably be best to simply stick with the now() function for your name. Much simpler, much lower chance of unintentional overwrites or conflicts.

    Hilary Stoupa

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