Simple Autonubering in infopath.

G

grisha0

Hi, im a new in infopath and i'm trying to create a form with an
repeatable table and one of the fields should be autonumerated for
example:

________________________________________________________________
| Number | Some field| Some other field| and another field here |
|________|___________|_________________|________________________|
| 1 | text | | |
|________|___________|_________________|________________________|
| 2 | text | | |
|________|___________|_________________|________________________|
| 3 | text | | |
|________|___________|_________________|________________________|
| 4 | text | | |
|________|___________|_________________|________________________|

I would like it to be autonumerated when user adds a row... for example
he had 3 rows ... 123 now he/she added fourth row ... now he/she has
1234 numbers and so on and so on :D

it don't need to be unique in the world scope... i want to create a
table with numerated rows... just it :]

Thanks for quick responce :D

Grisha :]
 
F

Franck Dauché

Hi Grisha,

You can write code to get the number of rows or get the highest number in
use and then set the value on the OnBeforeChange event. Of course, the
problem is if your users are deleting rows, it may not work as well if you
are just counting.

The alternative is to have a node in your schema to store the highest
number, you can read and increment that node each time a row is added.

Regards,

Franck Dauché
 
G

grisha0

Ok. so there is no out of the box solution for autonumbering and i
should use code :]

Thx for answer :]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top