Copy link to clipboard
Copied
I am trying to create a custom calculation that says...
If TotalExpense < or = DiscretionaryIncome then Seed Funding Text Field Shows "No"
If TotalExpense > DiscretionaryIncome then Seed Funding Text Field Shows "Yes"
Can anyone help me with this code?
Have anyone written anything like this before?
Use this as custom calculation script of "Seed Funding" field:
var Texpense = this.getField("TotalExpense").valueAsString;
var Dincome = this.getField("DiscretionaryIncome").valueAsString;
if(Texpense === "" || Dincome === "") {
event.value = "";}
else {
Texpense = Number(Texpense);
Dincome = Number(Dincome);
if(Texpense <= Dincome)
event.value = "No";
else if(Texpense > Dincome)
event.value = "Yes";}
Copy link to clipboard
Copied
Use this as custom calculation script of "Seed Funding" field:
var Texpense = this.getField("TotalExpense").valueAsString;
var Dincome = this.getField("DiscretionaryIncome").valueAsString;
if(Texpense === "" || Dincome === "") {
event.value = "";}
else {
Texpense = Number(Texpense);
Dincome = Number(Dincome);
if(Texpense <= Dincome)
event.value = "No";
else if(Texpense > Dincome)
event.value = "Yes";}
Copy link to clipboard
Copied
Thank you, Nesa. It worked like a charm!
I appreciate the help!