Copy link to clipboard
Copied
event.value = this.getField ("A").value - ( this.getField("A").value * this.getField("B").value )
For anyone interested, attached is the working file.
Copy link to clipboard
Copied
Subtotal = "A"
Discount = "B"
Copy link to clipboard
Copied
Try this:
var s = Number(this.getField("A").value);
var p = Number(this.getField("B").value);
if(p == 0)
event.value = s;
else
event.value = s*(1-p);
Copy link to clipboard
Copied
I was able to figure it out! Very simple solution actually.
For anyone interested, the equation I used was this:
event.value = this.getField ("A").value - ( this.getField("A").value * this.getField("B").value )
whereas
A = Subtotal
B = Discount Amount
Copy link to clipboard
Copied
event.value = this.getField ("A").value - ( this.getField("A").value * this.getField("B").value )
Copy link to clipboard
Copied
Copy link to clipboard
Copied
You don't need a script for this calculation.