A
Andrej Zafosnik
We are having problems with publishing AD information into the form Text
Box control field.
VB-script that we use to get Display Name of currently logged on AD-User:
___
On Error Resume Next
Set objUser = GetObject("LDAP://" & objADSystemInfo.UserName)
'WScript.Echo "Display Name: " & objUser.DisplayName <= just to check if
objUser.DisplayName has the right value.
___
We tried to add the OnLoad event for Text Box field in MS Script Editor. The
text we would like to show in this Text Box field is objUser.DisplayName
(current user).
Here is the code we use, to show informations on Infopath form via MS
Script Editor. It does displays the text in a form.
___
Dim objXML
Set objXML = XDocument.DOM.selectSingleNode("//my:field1")
objXML.text = "Text we want to display"
XDocument.View.ForceUpdate()
___
But when we add AD info it does not work
___
Dim objXML
Dim objADSystemInfo
Dim objUser
Set objXML = XDocument.DOM.selectSingleNode("//my:field1")
Set objADSystemInfo = CreateObject("ADSystemInfo")
Set objUser = GetObject("LDAP://" & objADSystemInfo.UserName)
objXML.text = objUser.DisplayName
XDocument.View.ForceUpdate()
___
Any ideas?
Andrej
Box control field.
VB-script that we use to get Display Name of currently logged on AD-User:
___
On Error Resume Next
Set objUser = GetObject("LDAP://" & objADSystemInfo.UserName)
'WScript.Echo "Display Name: " & objUser.DisplayName <= just to check if
objUser.DisplayName has the right value.
___
We tried to add the OnLoad event for Text Box field in MS Script Editor. The
text we would like to show in this Text Box field is objUser.DisplayName
(current user).
Here is the code we use, to show informations on Infopath form via MS
Script Editor. It does displays the text in a form.
___
Dim objXML
Set objXML = XDocument.DOM.selectSingleNode("//my:field1")
objXML.text = "Text we want to display"
XDocument.View.ForceUpdate()
___
But when we add AD info it does not work
___
Dim objXML
Dim objADSystemInfo
Dim objUser
Set objXML = XDocument.DOM.selectSingleNode("//my:field1")
Set objADSystemInfo = CreateObject("ADSystemInfo")
Set objUser = GetObject("LDAP://" & objADSystemInfo.UserName)
objXML.text = objUser.DisplayName
XDocument.View.ForceUpdate()
___
Any ideas?
Andrej