I have a form that sums up the order quantity field. The order quantity field is inside a repeating subform, not in a table. I used the below code to do the grand total. It works.
var fields = xfa.resolveNodes("ProductRow[*].OrderQuantity");
var total = 0;
for (var i=0; i <= fields.length-1; i++) {
total = total + fields.item(i).rawValue;
}
TotalSubform.TotalQuantity.rawValue = total;
QUESTION:
But I also need to do the order quantity total per page. I tried using the below code but I can't get it to work.
var fields = xfa.layout.pageContent(0 , "field", 0);
var total = 0;
for (var i=0; i <= fields.length-1; i++) {
if (fields.item(i).name == "ProductRow[*].OrderQuantity") {
total = total + fields.item(i).rawValue;
}
}
TotalSubform.TotalQuantityPage.rawValue = total;
Please help. Thanks in advance.