OK...bad code at first post...forgot to mention it is a 2dairy ds ... here is the code:
function btnSelectSCMAAccount::OnClick(eventObj) {
// Write your code here
// Get the DOM for the Seconday Data Source
var dat = XDocument.DataObjects("GetSCMAAccounts").DOM;
dat.setProperty("SelectionNamespaces", 'xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" xmlns:s0="http://tempuri.org" xmlns:ns1="urn:schemas-microsoft-com:sql:SqlRowSet1" ');
var xpath = "/dfs:myFields/dfs:dataFields/s0:GetSCMAAccountsResponse/s0:GetSCMAAccountsResult/ns1:SqlRowSet1/ns1:row1/ns1:scmaaccount";
var wVar = XDocument.DOM.selectSingleNode(xpath).text;
XDocument.UI.Alert("SCMA Account = " + wVar);
}
I get an "object required" message for the statement var wVar = XDocument.DOM.selectSingleNode(xpath).text;