Avatar

Level 10

Hi Laura,

You are right with the need for the nested for loop, If add this code to the calculation event.

 

    var nTotalRemitted = 0;

 

    var oAmountsRemitted = item.resolveNodes("SubRowtwo[*]");

 

    var nRemittedLength = item._SubRowtwo.count;

 

    for (nRemittedCount = 0; nRemittedCount < nRemittedLength; nRemittedCount++)

 

    {

 

        var oRemittedItem = oAmountsRemitted.item(nRemittedCount);

 

        var nAmountRemitted = parseFloat(oRemittedItem.AmountRemitted.rawValue);

 

        if (!isNaN(nAmountRemitted))

 

        {

 

            nTotalRemitted += parseFloat(oRemittedItem.AmountRemitted.rawValue);

 

        }

 

      }

 

see the sample https://sites.google.com/site/livecycledesignercookbooks/home/AFBS_PTM_bruce%20script_TEST.pdf?attre...

There are some comments in the sample explaining some of the code

Regards

Bruce