- Create 2 hidden fields in InfoPath, I called them NumID and NumberToAdd. NumID will contain the ID of the item, NumberToAdd is the amount to add to the NumID – my default value is set at 5000.
- Set up the Submit button in the form to perform the following steps when clicked:
1) Submit to the Form library
2) Query a data connection that pulls the ID from my Form Library
3) Set the NumID field to the ID of the item
4) Set the Form Number field to NumID + NumberToAdd
5) Submit to the Form library
6) Close the form
The query data connection is simply a receive connection to my form lib, and it pulls the ID field only. Since I have the NumberToAdd field set at 5000, it adds 5000 to the current ID and I end up with the Form Number field showing a value of 5001, 5002, etc.
Pretty simple, but sometimes the simple things give me the most problems! Thanks again to Clayton and Saed for the assistance via Twitter!