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

Conditional calculation not working with repeating table

$
0
0

Hi all,

 

I have a repeating table that can grow/shrink depending on how many entries a person needs. Each entry gets a value inputed in a "score" field. If all the scores are numbers, a simple sum of all the fields is calculated to get a number for total debit points. However, there are cases where an entry can be a "C", meaning that the score is Critical. In this case, the total debits sum should be blank or null.

 

The problem I run into is that the calculation will only work if the C "score" is on the first line of the repeating table. If it is on a second or subsequent line, then the debit score becomes 0. This is a problem because the total report score either reads as C if there is a critical debit or else 100 minus whatever the sum of the debits were. With my current set-up, a C entered on a second line of the table or later, may actually show up as a 100 for total report score because the total debit field was never set to blank or nullified.

 

Here is my code:

 

I'm using FormCalc now, but would be happy to go with JavaScript if it worked better.

 

if (ViolationsTableSubform.ViolationsTable.ViolCorrSection.ViolationsText[*].DebitVal[*] == "C") then

$ = "";

else

sum(ViolationsTableSubform.ViolationsTable.ViolationsText[*].DebitVal[*]);

endif

 

What am I doing wrong?


Viewing all articles
Browse latest Browse all 5571

Trending Articles



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