User Name, Infopath 2003

J

JoelS

Does anyone have a sample Infopath 2003 form they can share with me that will
show me exactly how to get the name of the person using the form?

Thanks,

Joel
 
S

steve

Does anyone have a sample Infopath 2003 form they can share with me that will
show me exactly how to get the name of the person using the form?

Thanks,

Joel

i think you'll find that it's not easy (sometimes i miss Lotus
Notes) ....... to use active directory you have to make the form
trusted, which means getting certificates and all that....i'm not as
expert, so see what others say.

you can use environment.username, which will return something like
"john.doe" if that's good enough, that easy....form doesn't have to
be full trust.

thisXDocument.DOM.selectSingleNode("//my:UserID").text =
Environment.UserName
 
Y

yogesh ghare

Double Click on the textbox field which u wat to populate with user name
in "default value" click on "Fx" button-->click on insert function-->in all
category-->select "user name" in functions--> press OK-->OK--OK
 
Y

yogesh ghare

you can also get current users username by web service
use http://<server name>/_vti_bin/userprofileservice.asmx
 
J

JoelS

Anuma;

I'm new to the code side of InfoPath. Is that line of code all I need and
do I put it in the onload event? Is userName a variable or the field that I
have defined on my form?

Thanks,

Joel
 
J

JoelS

Great. Now if my field name is "name" under myFields how would I code that
in your code sample?

Thanks,

Joel
 
J

JoelS

Is this code correct?

XDocument.DOM.selectSingleNode("/my:myFields/my:name").text =
System.Environment.UserName;

When I open the form I get an error 'System' is undefined

Thanks,

Joel
 
J

JoelS

I hate to be a complete dummy but I have no idea what you're talking about.

Can you give me detailed instructions?

Sorry,

Joel
 
J

JoelS

Anuma;

Did you get an email from me? I sent you one from the site below.

Thanks,

Joel
 

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