uniqueidentifier in Infopath

S

steveb

How do I add records to tables with a uniqueidentifier primary key using
Infopath?
I have the SQLServer tables set up with newId() as the default value for the
key but Infopath will not allow the form to be submitted without a value in
the primary key field.
 
F

Franck Dauché

Hi Steve,

You have couple of options here. In this forum, read the following threads:
- Automatically populate field on Form with data from SQL (posted on 8/10)
- UniqueID as primary key in Infopath (posted on 9/26)
- How do I get InfoPath to create an autonumber field? (posted on 10/10)

Regards,

Franck Dauché
 
G

Gregs List Acct

I have a simple VBSCript function that generates a text GUID value and use
this as the default value. Do a google search on
vbscript CreateGUID
and you'll find a dozen posts.


See the thread http://tinyurl.com/95qvq on how to use a function as a
default value. I'll actually be posting an FYI follow-up on this thread
shortly since I ran into a few gotchas (mostly my fault) and I still have one
problem.
 
S

steveb

Thanks, thats useful. However, I decided to follow the other option and avoid
using the UniqueId as Primary Key. This information can then be kept from the
user and the application can be developed using only core InfoPath functions.
 
S

steveb

Thanks, I decided to take the option of not using UniqueId as Primary key. It
keeps things simple and makes sense once you consider the risks of linking
tables through UniqueId.

Regards

Steve
 

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