Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

LiveCycle Conditional Sum in Expendable Table

$
0
0

Hello experts, help please!

 

I am creating a form that needs to do some conditional sum but after so many searches I still found no ways of making it work. Please see code below:

 

var rCount = tblAcctEnt._Row1.count;

var CRtotal = 0;

 

for(var i=0; i<rCount; i++){

 

if (tblAcctEnt.Row1[i].Cell2.rawValue == "CR"){

CRtotal =+ tblAcctEnt.Row1[i].Cell8.rawValue;

}

 

}

 

this.rawValue = CRtotal;

 

LC form.PNG

 

All I wanted to do is just making a sum of all the "LCY" values ("Cell8" - Decimal Field) that has "CR" ("Cell2" - Text Field) in front and put the sum value in the "Total CR" (Decimal Field). but looks like the code doesn't work for me. (Code is located in Calculate as JavaScript).

 

I tried debugging the code and for some reason I get "CR" as return value when I do "this.rawValue = Row1.Cell2.rawValue;" but getting nothing when I do "this.raValue = Row1[0].Cell2.rawValue". Can someone explain why I get 2 different results when the condition should be exactly the same please and how can I make the conditional sum work?

 

Many Many Thanks.


Viewing all articles
Browse latest Browse all 5571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>