R
Rhonda
I have a form that I am trying to fill in user information on the page load
from active directory. I wrote a web service to get the information but I
can't seem to get the data to the form. Below is my code. I can look at the
dataconnection in the UI and see the fields and I can execute the web service
and get back the data I am expecting.
I just don't know what I am missing and am having a hard time finding a real
life example. I am getting a Runtime Error Object Required on the Set User
= line.
I'm passing in the UserName which I am getting from.
Set objNetwork = CreateObject("WScript.Network")
userName = objNetwork.UserName
Dim UserDoc
Set UserDoc = XDocument.DataObjects("GetUser").DOM
UserDoc.setProperty _
"SelectionNamespaces","xmlns:dfs=""http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"" " & _
"xmlns:s0=""http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"" "
Dim User
Set User =
UserDoc.selectSingleNode("/dfs:myFields/dfs:queryFields/dfs:GetUser/User").text = XDocument.DOM.selectSingleNode("/my:myFields/my:Login").text
UserDoc.Query()
If User <> "" Then
XDocument.DOM.selectSingleNode("/my:myFields/my:Seller").text =
User.attributes.getNamedItem("FullName").text
XDocument.DOM.selectSingleNode("/my:myFields/my:Email").text =
User.attributes.getNamedItem("Email").text
XDocument.DOM.selectSingleNode("/my:myFields/my:WorkPhone").text =
User.attributes.getNamedItem("Phone").text
Any help would be greatly appreciated. I am getting desperate and frustrated.
Thanks a ton,
from active directory. I wrote a web service to get the information but I
can't seem to get the data to the form. Below is my code. I can look at the
dataconnection in the UI and see the fields and I can execute the web service
and get back the data I am expecting.
I just don't know what I am missing and am having a hard time finding a real
life example. I am getting a Runtime Error Object Required on the Set User
= line.
I'm passing in the UserName which I am getting from.
Set objNetwork = CreateObject("WScript.Network")
userName = objNetwork.UserName
Dim UserDoc
Set UserDoc = XDocument.DataObjects("GetUser").DOM
UserDoc.setProperty _
"SelectionNamespaces","xmlns:dfs=""http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"" " & _
"xmlns:s0=""http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"" "
Dim User
Set User =
UserDoc.selectSingleNode("/dfs:myFields/dfs:queryFields/dfs:GetUser/User").text = XDocument.DOM.selectSingleNode("/my:myFields/my:Login").text
UserDoc.Query()
If User <> "" Then
XDocument.DOM.selectSingleNode("/my:myFields/my:Seller").text =
User.attributes.getNamedItem("FullName").text
XDocument.DOM.selectSingleNode("/my:myFields/my:Email").text =
User.attributes.getNamedItem("Email").text
XDocument.DOM.selectSingleNode("/my:myFields/my:WorkPhone").text =
User.attributes.getNamedItem("Phone").text
Any help would be greatly appreciated. I am getting desperate and frustrated.
Thanks a ton,