Question

The form is submit to email. I want to get the date of the submit as a variable. Setting a variable with now() is not adequate as the variable changes when the form is opened again after submission.

Était-ce utile?

La solution

Some possible solutions:

  1. Simply create a field in your form, set its default value to the now() function, and uncheck "Update this value when the result of the formula is recalculated." and you should be all set.

    via http://www.infopathdev.com/forums/p/12569/44295.aspx#44295

  2. Create a variable submissionDate to store the submission date. When the user submits the form, set submissionDate to the current date. Add a check to only set the date if the variable does not already contain a value. If not implemented this exact way, this idea could be used in some form. I don't see why it wouldn't work.

  3. Similar solution to #2 suggested here: I need a submit date that doesn't change.

    You just need to add a field to your form which saves the original file name.

    Have a rule on open which if filename is blank, sets is to your concat (addedtotable, ID). Then in your SP submit use this field as the file name.

    On subsequent opens since it has a value the file name will not change.

    On your exisitng forms you will need to manually set this since you want to retain the original file name but on any new this solves your issue.

    Another option is to query the document library and maybe look for your user's name if you identify the user and the most recent file they have opened.

  4. A few more suggestions here: Submitting Infopath forms to a Sharepoint Library - how can I generate a unique name for each record.

Autres conseils

I had the same issue. Created a unique Form ID field based on the date/time using the now() function. Problem was that ID changed, each time form was updated which presented a problem.

I am using InfoPath 2013. To resolve the issue:

  1. Select the Form Field for the ID.
  2. Using Ribbon, click Control Properties.
  3. Select Default Value or Field Properties, which brings up the Field or Group Properties window.
  4. Uncheck "Refresh Value when formula is recalculated.
  5. Click OK and republish the form. Test and it works.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top