Setting default values in script: 1 gotcha, 1 question

G

Gregs List Acct

1st THE GOTCHA:
I have a VBScript function that creates a GUID and needed to use it as the
default value. I read the thread http://tinyurl.com/95qvq, and thought I
could apply it directly to the "Default Property" field, but no -- you have
use a *rule*. If you follow Scott's instructions explicitly you should be
OK. When I tried the same technique on the *Default Value* field, I got an
error which is documented in the post.

FOLLOW UP QUESTION:
For new items, my text box is now defaulting via the rule to a GUID -- BUT,
when I first open the form, if no records exist, InfoPath creates a blank one
and is DOESN'T default to using my GUID function. Why doesn't the rule seem
to be firing for the first blank rule created by InfoPath?
 
F

Franck Dauché

Hi,

If you are trying to set your default value, why don't you call that
function on form load and set the node value there?
Just a thought...

Regards,

Franck Dauché
 
G

Gregs List Acct

That's what I ended up doing: using form load (or view change). It's just
the feeling that I was *that* close. I can set the default for 'fieldX' to
the canned function Today() and this always works: wether a blank form or
not, but using the trick for calling a custom script function only works when
at least one record pre-exists. Just seems counter-intuitive. No worries
though. thanks!
 

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