Hello everybody! I'm desperate and need assistance. I have InfoPath 2007 form with JS code behind. Also I have a WCF service. Here's a JS code in XDocument::OnLoad(eventObj) function to fill in drop down list with data.
var formName = 'RegistrationForm';
var code = XDocument.DOM.selectSingleNode('/Root/@code').text;
var version = XDocument.DOM.selectSingleNode('/Root/@ver').text;
try
{
var ws = XDocument.DataObjects('GetReference');
ws.DOM.setProperty("SelectionNamespaces", "xmlns:dfs=\"http://schemas.microsoft.com/office/infopath/2003/dataFormSolution\" xmlns:ns12=\"http://tempuri.org/\"");
ws.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/ns12:GetReference/ns12:processCode").text = code;
ws.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/ns12:GetReference/ns12:processVersion").text = version;
ws.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/ns12:GetReference/ns12:formCode").text = formName;
ws.Query();
XDocument.UI.Alert('Data loaded: ' + ws.DOM.xml);
}
catch(err)
{
XDocument.UI.Alert('Oops, something went wrong. Contact developers.');
XDocument.View.Window.Close(true);
}
The problem is that drop down list is empty. But an alert after ws.Query() displays correct XML with data. Also via Fiddler I can see that request was successful and data was loaded.
What can be a reason for such a strange behavoir?