Search code examples
infopathautonumber

InfoPath autonumbering


I was working on a project, basically it's using MS InfoPath to design a form. I am currently facing an issue with the autonumbering.

Here is the scenario:

  • User submits a form (ID: 1)
  • Admin receives the form (ID: 1) - correct
  • Admin edits the same form (ID: 1)
  • Admin updates/submits the form (max(ID)+1) - wrong

Is there a way to keep the numbering if the 2nd user updates the same form?


Solution

  • You could use a hidden field to check against when submitting. Set the default value to 0. Add a rule on submit where if the value of hidden field is 0, set max(ID)+1 as you're currently doing. Also, set the value of this hidden field to 1 when submitting.

    Have a second rule to handle when the value of the hidden field is 1 (existing form). In this scenario, you use the same ID.