First, InfoPath absolutely ROCKS! Okay, got that off my chest.
I have an example template I've worked up that performs the following:
In the OnLoad for the form:
1. Uses a WScript.Network object to get your windows login and stuff it to a control (I will later hide all of the controls that I am speaking of).
2. Uses some code that refers to the value in the text box that holds the login to query a web service that we have that returns employee information (EmplID, Name, Email, ManagerEmplID, etc.).
3. I have bound several text boxes to the first web service return and they work fine and get populated with the users information.
I then wish to use the value in the bound text box for ManagerEmplID (which was populated by the first web service call) in another batch of code to go use the same web service (passing it the users ManagerEmplID) to get the manager's information (Name, Email, etc.).
I notice that the text boxes that are bound to secondary data sources don't appear to show up in the DOM for the main form. How then do I refer to the freshly populated ManagerEmplID value so that I can go get the manager information?
Thanks for any help!!
I have found a bit more useful information. Apparently, in the OnLoad event, the fields haven't been layed out on the form yet, so referring to the value in the control that I stuffed (using the Web Service) will simply fail because technically nothing is even in the control yet.
I therefore need a way to refer to the first web service (and the ManagerEmplID field/node) so that I can pass it to the second web service and get back Manager info.
Hope that makes sense!
ooh...getting closer...I can view the DOM of the first web service and it has what I want...but I don't understand how to refer to the correct node or whatever.
Here's what the DOM looks like when I'm in the script editor in debugging (and I enter: ?objwsUser.DOM):
xml: "<dfs:myFields xmlns:dfs=""http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"" xmlns:s0=""http://tempuri.org/EmpInfo/WS_EmployeeProfile.asmx"" xmlns:my=""http://schemas.microsoft.com/office/infopath/2003/myXSD/2004-09-21T20:02:50"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""><dfs:queryFields><s0:getBMIEmployeeWithNetworkID><s0:stNetworkID>ziggy</s0:stNetworkID></s0:getBMIEmployeeWithNetworkID></dfs:queryFields><dfs:dataFields><getBMIEmployeeWithNetworkIDResponse xmlns=""http://tempuri.org/EmpInfo/WS_EmployeeProfile.asmx""><getBMIEmployeeWithNetworkIDResult><ROOT xmlns=""""><EMPLOYEE EMPLID=""3A435"" PNNL_PAY_NO=""3A435"" HANFORD_ID=""0005933"" ACTIVE_SW=""Y"" ASGN_CORE_CAPABILITY=""T10"" BUSINESS_TITLE=""Scientist III"" COCS_CD=""S100"" COMPANY=""PNL"" CONTACT_LOCATION=""WARI01"" CONTACT_BLD_NO=""ISB2"" CONTACT_ROOM_NO=""332"" CONTACT_MSIN=""K7-54"" CONTACT_BMI_MSIN=""K7
-54"" CONTACT_COUNTRY_CD=""USA"" CONTACT_WORK_PHONE=""509/375-6699"" COR_CD=""62"" COR_AMOUNT=""54.8500"" COST_CD=""D9C28"" DEPTID=""116012"" FIRST_NAME=""Kevin"" FULL_PART_TIME=""F"" INTERNET_EMAIL_ADDRESS=""
[email protected]"" LAST_NAME=""Selby"" MIDDLE_INITIAL=""B"" NAME=""Selby,Kevin B"" NAME_PREFIX=""Mr"" NETWORK_ID=""ZIGGY"" NETWORK_DOMAIN=""PNL"" OFF_SPACE_OCCUPIED_SW=""N"" PAYGROUP=""M01"" PER_STATUS=""E"" POSITION_NO=""00006013"" PREF_FIRST_NAME=""Kevin"" PREF_LAST_NAME=""Selby"" PREF_MIDDLE_INIT=""B"" PREFERRED_NAME=""Selby,Kevin B"" PREFERRED_NAME_FM=""Selby, Kevin B"" PRIMARY_AREA=""RCHN"" PRIMARY_LOCATION=""WARI01"" PRIMARY_BLD_NO=""ISB2"" PRIMARY_ROOM_NO=""332"" PRIMARY_MSIN=""K7-54"" PRIMARY_BMI_MSIN=""K7-54"" PRIMARY_COUNTRY_CD=""USA"" PRIMARY_WORK_PHONE=""509/375-6699"" REPORTING_MGR_EMPLID=""3C343"" REPORTING_ORG_ID=""A92350000"" TYPE=""S"" SNAP_DATE1=""2004-09-20T20:01:31"" SNAP_DATE2=""2004-09-20T20:57:08""/></ROOT></getBMIEmployeeWithNetworkIDResult></getBMIEmployeeWithNetworkIDResponse>
</dfs:dataFields></dfs:myFields>
So how do I refer to the REPORTING_MGR_EMPLID field in code?
Sorry for such a silly question, but I can't seem to get that field.
Kevin