How to set a field's default value to GUID?

X

xinfli

I had the same problem to set a field's default value to GUID, and I
cannot open the URL http://tinyurl.com/95qvq now, so I write a
function to generate GUID inthe Changed event of this field (I'm using
C# language).

But I find the same problem that when first open the form, nothing
works, how does this happens? and how to resolve it? could anyone give
more detail?

Thanks!
 
G

Greg Collins [InfoPath MVP]

Are you using .ToString() to convert the guid to a string?

This is what I use:

Guid.NewGuid().ToString("N")

The "N" in the ToString() function says to strip out the dashes. If you want the dashes, leave out the "N".
 

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