1

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?

freginold
  • 3,946
  • 3
  • 13
  • 28
Blake Kong
  • 35
  • 6

1 Answers1

0

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.

user2051770
  • 684
  • 7
  • 18
  • Hi, i get what you meant from the first statement. The second statement kind of confusing. – Blake Kong Jan 13 '15 at 02:35
  • Actually you may not need that second rule now that I think about it. If you use the hidden field to generate your form name, the first rule will fire only the first the the form is submit. After that the hidden field value will not change, thus your ID shouldn't change either (which is what you want). Rather than setting the value of the hidden field to "1" like I mentioned, just set it to the value of "max(ID)+1" the first time the form is submit, and use that to generate your form name or whatever you need this ID# for. – user2051770 Jan 14 '15 at 15:50