Thanks for your reply.
I read this post, but I don't think that the replies to that topic give a pratical solution, at least a solution to my question.
I customized a button and wrote the following JS codes:
function CTRL4_5::OnClick(eventObj)
{
//Get a reference to the Web Service data connection
var dataObject;
dataObject = XDocument.DataObjects.Item("wsConn");
//Set the SelectionNamespaces property so you can navigate the web service XML()
dataObject.DOM.setProperty("SelectionNamespaces", "xmlns:dfs=\"http:/schemas.microsoft.com/office/infopath/2003/dataFormSolution\"" + "xmlns:tns=\"http:/tempuri.org/\"");
//Get a reference to the parameter in the web service
var xml;
xml = dataObject.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/tns:wsConn/tns:INPUTDATA");
xml.text = XDocument.Dom.xml;
var num;
num = XDocument.DOM.selectSingleNode("/FAQ/num");
var id;
id = dataObject.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/tns:wsConn/tns:NUM");
id.text = num.text;
dataObject.QueryAdapter.Query();
}
Here,
wsConn is a websevice connection defined in
Data Connections. Is it right?
If yes, why that when I click this button, error occurs with the message "
An item with the following index does not exist in the collection: wsConn
File:script.js
Line:27"?
Many thanks!
quote:
Originally posted by K.Ramana Reddy
Hi,
Check out this link, you can get some information.
http://infopathdev.com/forums/topic.asp?TOPIC_ID=2173
I hope this will help for you,
Thanks.