Get Form ID - InfoPath Dev
in

InfoPath Dev

Get Form ID

Last post 01-24-2012 06:31 AM by jaxkookie. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 01-20-2012 11:54 AM

    Get Form ID

    I am looking more for the logic. I cant seem to think this one through. I understand that the ID is not generated until form is submitted initially. I need to retrive the ID and populate a field. I am guessing I can either have a button event or on form load exec code to submit the form and grab the ID, but not really sure how to go about this. Any suggestions?

    Kind regards,
    Larry
    Filed under:
  • 01-22-2012 02:56 AM In reply to

    Hi jaxkookie,

    When you say Form ID, are you pertaining to the ID of the form in SharePoint? Perhaps it will help to be a little more specific so other posters would understand the scenario.

    Thank you,

    Jo-Anne Alfafara
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™
  • 01-22-2012 06:28 AM In reply to

    Apoligies. I want the sharepoint form library id, which cannot be retrived until "submit". Since i have figure out a soultion using rules. For testing on form load i generate a file name using "now()" set a field to use in my Main submit. Second action, querys my form library data source. 3rd action sets a field value to the id of the form. Now i am toying with figuring out a way to change the file name, but not add a new form just update existing. Can this be done?
    Kind regards,
    Larry
  • 01-22-2012 06:55 AM In reply to

    Sorry if I'm a bit confused. Are you trying to get the Form ID and use it as the filename of your form?

    Jo-Anne Alfafara
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™
  • 01-23-2012 04:53 AM In reply to

    apoliigies again. I do not believe I stated that i wanted to use the ID in the form name. Initially I wanted the SharePoint List item ID and I wanted to store it in the form. the solution to automate getting the ID required that I generate a file name. Currently I am setting a field value (FileName) = to "now()" if blank on form load. This allows me to automate form submission and generate the item ID. Now that I am storing the ID on the form I can do what I want with it. What I am trying to figure out now is can a form Name (or file name) be changed without creating a new form? I am not asking to use the ID in the name, I just want to know if it is possible to change the Name value.

    Example: currently on form load, immeadiately it generates a file name like this - "2012-01-23T07_08_46". Because this is automated it is the only way to generate a unique name. This name has no meaning when reviewing the SharePoint library. I want to change this value the next time the user updates and saves the form so the form name has meaning, using other fields in the form.

    Is this possible?

    Kind regards,
    Larry
  • 01-23-2012 10:39 AM In reply to

    Hi - to the best of my knowledge, the answer is "no" - just like in the file system, saving the same file name in the same location overwrites the original file - and that's what ShP does on a submit, it overwrites the original file. If the name changes, a new file is created. Perhaps you could use a custom workflow to clean up the previous versions? Or, simply promote the fields that have meaning, and save the file as username and now, which is unique, and at least is not meaningless....

    Hilary Stoupa

  • 01-24-2012 06:31 AM In reply to

    Thanks Hilary, I figured as much, but I needed to confirm. I do like the workflow idea. I may play with that.

    have a great day

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