I have a form that I am building based on an Access database. I am an InfoPath newbie and just trying to learn jscript. I want to receive data from our HR systems to prefill specific fields when the user opens the form. I've been able to get the LAN ID field to populate on the form but can't get the other data elements that are part of my secondary data connection (web service) to show up on the form .Below is the code I'm using. Any help on how to add the text box controls and get them to pull the data correctly would be appreciated.
function XDocument::OnLoad(eventObj)
{
XDocument.QueryAdapter.Timeout=60;
var userIDField=XDocument.DOM.selectSingleNode("dfs:myFields/my:LANUserID");
var userID=GetUserID();
if (userIDField.text == "") {userIDField.text=userID;}
}
//Also need for web service//
function GetUserID()
{
var objNetwork = new ActiveXObject("Wscript.network");
var uid = objNetwork.UserName;
return uid;
}