-
Yeah that makes total sense.
Thanks for the tips!
-
PROBLEM:
You have installed the AD Web Service and would like to set a value in your form to equal a value returned by the Web service, specifically, you'd like to pre-populate the user name or user info.
SOLUTION:
(In the InfoPath Designer )
After you add a data connection for the GetMyInfo method of the AD Web Service and specify to retrieve ...
-
if the jscript works should the vbscript work?
do i need to have anything special installed for the vb version to work?
-
Bummer that worked for me when I threw that into an OnLoad event.
This one also works for me...after that I am not sure I know what else will work.
Dim sUserName
sUserName = CreateObject(''Wscript.Shell'').Environment(''Process'').Item(''UserName'')
XDocument.UI.Alert(sUserName)
-
I'm trying to get the current users username during the OnLoad Event but the vbscript is thowing an error saying:
ActiveX component can't create object: 'WScript.Network'
Dim wsh
Set wsh = CreateObject(''WScript.Network'')
un = wsh.UserName
XDocument.DOM.selectSingleNode(''//my:myFields/my:field14'').text = un
any ideas?
-
Yes it can, one of my clients wanted everything in VBScript:
Dim wsh
Set wsh = CreateObject(''WScript.Network'')
XDocument.UI.Alert(wsh.UserName)
-
Ah, I think I get you now. Although I have already figured out a work-around and I think I'm going to stick with it. (Makes more sense in my head and with the form/data structure I have laid out).
Folder ...
-
can this same thing be done in vbscript?
-
Thanks VT.
I had tried the activex approach before but i didn't seem to work.
may have been my coding.
-
Was waiting for that question :-)
That was one of the reasons why I did not use it because of that prompt but I had the ability to using ASP.NET to get the current user.
I believe you can get rid of it by messing around with IE security options. InfoPath is built on IE security model. I am not an expert on this topic. If you have the InfoPath ...