views:

776

answers:

1

I am designing an infopath (Change Request) form:

1)How can i add a text box that automaticaly increments to the next number when a new form is created (adding a new Change Request form to the form library).

2)How do i retrieve information from an existing form to the new form.

NOTE: The field is not inside a repeating table. I need to generate the next Change Request number on each new Change Request form.

TIA!

+1  A: 

There is no build-in way to do this, but there are several ways to achieve what you want (Database query or SPList query). But this kind of request somehow smells like a workaround for an other problem. Common cases for increasing numbers are:

  • unique IDs
  • count the Requests
  • make referable by external list (same as ID)
  • make IDs guessable (time stamps are not)

If you need an ID: In most cases you are not forced to use integer IDs. Simply use the form title as a natural ID. (e.g. customer + timestamp)

If you need guessable IDs, you need them because an external system wants to access or refer to the request. In that case try to change the pull-direction into a push-direction (e.g. by using workflows) or let your other system provide a "getID" function that can be called by your form to obtain a known ID (no guessing needed).

Anyway - for me, it looks like you want to achieve this to solve some other problem. Maybe there are different solutions for that problem too?

MrFox

related questions