Hi,
I'm getting frustrated with this..i'm sure it's simple but my custom calculation script doesnt work
It doesnt add properly.
var a = this.getField("c_CASH_Row 16_2").value;
var b = this.getField("c_CASH_Row 2_2").value;
var c = this.getField("c_CASH_Row_12_2").value;
var d = this.getField("c_CASH_Row_13_2").value;
var e = this.getField("c_CASH_Row_14_2").value;
var f = this.getField("c_CASH_Row_15_2").value;
var g = this.getField("c_CASH_Row_18_2").value;
var h = this.getField("c_CASH_Row_19_2").value;
var i = this.getField("c_CASH_Row_1_2").value;
var j = this.getField("c_CASH_Row_20_2").value;
var k = this.getField("c_CASH_Row_22_2").value;
var l = this.getField("c_CASH_Row_24_2").value;
var m = this.getField("c_CASH_Row_26_2").value;
var n = this.getField("c_CASH_Row_27_2").value;
var o = this.getField("c_CASH_Row_30_2").value;
var p = this.getField("c_CASH_Row_31_2").value;
var q = this.getField("c_CASH_Row_32_2").value;
var r = this.getField("c_CASH_Row_3_2").value;
var s = this.getField("c_CASH_Row_4_2").value;
var t = this.getField("c_CASH_Row_5_2").value;
var u = this.getField("c_CASH_Row_6_2").value;
var v = this.getField("c_CASH_Row_7_2").value;
var w = this.getField("c_CASH_Row_8_2").value;
var x = this.getField("c_CASH_Row_9_2").value;
var sum = a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x;
event.value = sum;
if (sum > 200000) {
// Set value of field to zero
event.value = 0;
app.alert({cMsg: "Your total funding request cannot exceed $200,000.00", nIcon: 1, nType: 0, cTitle: "error", });
}
Please help! Thank you!
(function () {
// Initialize variable to hold the sum of the fields
var sum = 0;
var a = this.getField("c_CASH_Row 16_2").value;
var b = this.getField("c_CASH_Row 2_2").value;
var c = this.getField("c_CASH_Row_12_2").value;
var d = this.getField("c_CASH_Row_13_2").value;
var e = this.getField("c_CASH_Row_14_2").value;
var f = this.getField("c_CASH_Row_15_2").value;
var g = this.getField("c_CASH_Row_18_2").value;
var h = this.getField("c_CASH_Row_19_2").value;
var i = this.getField("c_CASH_Row_1_2").value;
var j = this.getField("c_CASH_Row_20_2").value;
var k = this.getField("c_CASH_Row_22_2").value;
var l = this.getField("c_CASH_Row_24_2").value;
var m = this.getField("c_CASH_Row_26_2").value;
var n = this.getField("c_CASH_Row_27_2").value;
var o = this.getField("c_CASH_Row_30_2").value;
var p = this.getField("c_CASH_Row_31_2").value;
var q = this.getField("c_CASH_Row_32_2").value;
var r = this.getField("c_CASH_Row_3_2").value;
var s = this.getField("c_CASH_Row_4_2").value;
var t = this.getField("c_CASH_Row_5_2").value;
var u = this.getField("c_CASH_Row_6_2").value;
var v = this.getField("c_CASH_Row_7_2").value;
var w = this.getField("c_CASH_Row_8_2").value;
var x = this.getField("c_CASH_Row_9_2").value;
sum = a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x;
event.value = sum;
if (sum > 200000) {app.alert({cMsg: "Your total funding request cannot exceed $200,000.00", nIcon: 1, nType: 0, cTitle: "error", });
}
})();