Copy link to clipboard
Copied
I have made a calculation for a field:
this.getField("Rental Year 3").value = (this.getField("Rental Year 2").value * (this.getField("Annual Increase").value /100)) + this.getField("Rental Year 2").value;
However, I only want the calculation to apply if another field (Lease Term) has a value greater than or equal to 3. If the value is less than three I would like this field to equal 0.
How do I add this condition?
Use something like this:
var val = 0;
if (this.getField("Lease Term").value >= 3)
val = (this.getField("Rental Year 2").value * (this.getField("Annual Increase").value /100)) + this.getField("Rental Year 2").value;
this.getField("Rental Year 3").value = val;
Copy link to clipboard
Copied
Use something like this:
var val = 0;
if (this.getField("Lease Term").value >= 3)
val = (this.getField("Rental Year 2").value * (this.getField("Annual Increase").value /100)) + this.getField("Rental Year 2").value;
this.getField("Rental Year 3").value = val;
Find more inspiration, events, and resources on the new Adobe Community
Explore Now