Programming Help

B

Brian Farnhill

Hey guys and gals,

I'm really really really new to InfoPath, but I think it can do what I'm
after, I'm just not 100% sure of how.

I have come up with a form that I want to use as a browser based form and I
want to prepopulate some of the fields. The data that I am prepopulating them
with is based on the current user, and is returned from a web service (so
when I go to the form, it recognises that I am farnhillb and then it sends my
windows logon name to a web service that returns the data to use on the form).

Can anyone point me in the direction of some help, or some ideas of how to
get the windows username of the logged on user in InfoPath.

I will be looking to prepopulate the fields in response to a button pressed
on the the form, not in the form startup event.

Thanks in advance for any help I can get!

Cheers
 
K

K.Ramana Reddy(GGK Tech)

Hi,

If you use C# use below code to get logined user name,
System.Environment.UserName;

If you use Vb Script,
Dim X
set X = createobject("WSCRIPT.Network")

XDocument.DOM.selectSingleNode("/my:myFields/my:field1").text=X.UserName

I hope this will help for you.
 
B

Brian Farnhill

Thanks fantastic, thank you!

K.Ramana Reddy(GGK Tech) said:
Hi,

If you use C# use below code to get logined user name,
System.Environment.UserName;

If you use Vb Script,
Dim X
set X = createobject("WSCRIPT.Network")

XDocument.DOM.selectSingleNode("/my:myFields/my:field1").text=X.UserName

I hope this will help for you.
 

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