- Mark as New
- Follow
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
Hi Laura,
Have a look at this modified version of your form, https://sites.google.com/site/livecycledesignercookbooks/home/AFBS_OverpaymentReport_010115.pdf?attr.... I have added a subform called PayerTotals, which has a per insurance company summary created in its calculate event. The code looks like;
var oFields = xfa.resolveNodes("SummarySub[*]");
var nNodesLength = _SummarySub.count;
var nSum = 0;
var insuranceCompanies = {}
for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++) {
var item = oFields.item(nNodeCount);
if (!item.InsuranceCompany.isNull && !item.OverpaymentAmount.isNull) {
if (insuranceCompanies[item.InsuranceCompany.rawValue]) {
insuranceCompanies[item.InsuranceCompany.rawValue] += item.OverpaymentAmount.rawValue
else {
insuranceCompanies[item.InsuranceCompany.rawValue] = item.OverpaymentAmount.rawValue
nSum += item.OverpaymentAmount.rawValue;
totalover.rawValue = nSum;
_PayerTotal.setInstances(0);
for (var insuranceCompany in insuranceCompanies) {
var payerTotal = _PayerTotal.addInstance();
payerTotal.InsuranceCompany.rawValue = insuranceCompany;
payerTotal.totalover.rawValue = insuranceCompanies[insuranceCompany];
Hope this helps
Bruce
Views
Replies
Total Likes