L
liz-kma
I am using this syntax in the script.js file to attempt to set the parameters
before requerying a secondary data source:
g_oXmlUsers = XDocument.DataObjects("GetPositions").DOM;
g_oXmlUsers.setProperty("SelectionNamespaces",
'xmlns:tns=\"http://tempuri.org/\"
xmlns:dfs=\"http://schemas.microsoft.com/office/infopath/2003/dataFormSolution\"');
g_oXmlUsers.selectSingleNode("/dfs:queryFields/tns:GetPositions/tns:firstName").value = "First Name";
But it always returns a null or empty node error message.
Here's the form file for my secondary data source:
<dfs:myFields
xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" xmlns:tns="http://tempuri.org"
xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2003-04-22T21:41:07" 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>
<tns:GetPositions>
<tns:firstName></tns:firstName>
<tns:lastName></tns:lastName>
<tns:requisitionNumber></tns:requisitionNumber>
</tns:GetPositions>
</dfs:queryFields>
<dfs:dataFields>
<tns:GetPositionsResponse>
<tns:GetPositionsResult>
<NewDataSet>
<Positions>
<PositionID></PositionID>
<PositionName></PositionName>
<EmployeeID></EmployeeID>
<FormattedName></FormattedName>
<RoleID></RoleID>
<RoleName></RoleName>
</Positions>
</NewDataSet>
</tns:GetPositionsResult>
</tns:GetPositionsResponse>
</dfs:dataFields>
</dfs:myFields>
Any thoughts?
Thanks!
before requerying a secondary data source:
g_oXmlUsers = XDocument.DataObjects("GetPositions").DOM;
g_oXmlUsers.setProperty("SelectionNamespaces",
'xmlns:tns=\"http://tempuri.org/\"
xmlns:dfs=\"http://schemas.microsoft.com/office/infopath/2003/dataFormSolution\"');
g_oXmlUsers.selectSingleNode("/dfs:queryFields/tns:GetPositions/tns:firstName").value = "First Name";
But it always returns a null or empty node error message.
Here's the form file for my secondary data source:
<dfs:myFields
xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" xmlns:tns="http://tempuri.org"
xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2003-04-22T21:41:07" 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>
<tns:GetPositions>
<tns:firstName></tns:firstName>
<tns:lastName></tns:lastName>
<tns:requisitionNumber></tns:requisitionNumber>
</tns:GetPositions>
</dfs:queryFields>
<dfs:dataFields>
<tns:GetPositionsResponse>
<tns:GetPositionsResult>
<NewDataSet>
<Positions>
<PositionID></PositionID>
<PositionName></PositionName>
<EmployeeID></EmployeeID>
<FormattedName></FormattedName>
<RoleID></RoleID>
<RoleName></RoleName>
</Positions>
</NewDataSet>
</tns:GetPositionsResult>
</tns:GetPositionsResponse>
</dfs:dataFields>
</dfs:myFields>
Any thoughts?
Thanks!