Subtract currency formatted fields for running total
- September 13, 2024
- 2 replies
- 499 views
I need to subtract a series of currency fields to get a running total as they are being filled in. I have tried both a simplified fields notation and custom calculation script and I still can't get anything to show up in the running total field. Screenshots attached. Scripts below. Any guidance appreciated, clearly I'm no JavaScript expert. Thanks!
Simplified (I have tried this as a long series of subtractions and the way you see it below):
Total Cost - (FederalGrants + ScholarshipAmount1 + ScholarshipAmount2 + ScholarshipAmount3 + Subsidized + Unsubsidized + PLUS + VA + Agency + AlternativeLoans + Payments)
Custom:
event.value = this.getField("Total Cost").value - this.getField("FederalGrants").value - this.getField("ScholarshipAmount1").value - this.getField("ScholarshipAmount2").value - this.getField("ScholarshipAmount3").value - this.getField("Subsidized").value - this.getField("Unsubsidized").value - this.getField("PLUS").value - this.getField("VA").value - this.getField("Agency").value, this.getField("AlternativeLoans").value - this.getField("Payments").value - result;
