Autogenerated ID ?

A

Andreas Zita

Hi

I have a simple Xml Schema with an array of Items where each Item has an
xs:ID attribute. Can I configure my InfoPath for this Schema to
automatically fill out a new ID so that the user won't need to bother with
this?

/Andreas Zita
 
A

Andreas Zita

I sort of solved it myself. I think.

I changed the Item ID attribute to xs:integer and added a NextID attribute
(also xs:integer) to the Item Array element. In InfoPath I added a "Default
Value" for the Item @ID to @NextID and a rule "@NextID = @NextID + 1".

It works fine but I don't know if this is a good way of doing this? I would
prefer if InfoPath could handle ID-generation by it self?

/Andreas Zita
 
R

Renee in Juneau

Good. It sounds like you've found a solution that works for you.

Are you looking for unique IDs across instances or just within the
form instance that's currently open?

If the latter, you could autoincrement within the form by setting
ID's default value to:
count(.)+1
 

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