Good day!
I need to make history of decisions with repeatable section, which contains users decisions. I made it with web-service, which enter data into database, then extract it on form open. The problem is display data from web-service when document has more than one root. For example, document has 3 Roots in GroupRoot and web service returns xml with 3 sections. I made a conditional formatting on repeatable section from web-service secondary datasource - hide if field not equal field and as a result nothing is dispayed. After I tried to to use jscript method in conditional formatting on the same datasource. Every Root called method 3 times and only first decision displayed in every Root, but it must be dispayed only in first Root.
I used to call method like this - "xdExtension:CheckRequestNum(string(RequestNum)) = false()". Can someone tell me how can I get current Root node? Or how can I make it without updating template scheme?
Method code:
function CheckRequestNum(ReqNum)
{
debugger;
var node = null;
var nodes = XDocument.DOM.selectNodes("/GroupRoot/Root");
//var RequestNum = XDocument.DOM.selectSingleNode("Root/Request/RequestNum").text;
//if (ReqNum == RequestNum) return true;
//else return false;
while (node = nodes.nextNode())
{
var RequestNum = node.selectSingleNode("Request/RequestNum").text;
if (ReqNum == RequestNum) return true;
else return false;
}
}