Copy link to clipboard
Copied
I've tried every variation I can think of to make this work and it just isn't.
As seen below, the dropdown is for the customer to choose their payment method.
If they don't select one, the number in the column to the right is 0..
If they select "Wire (no fee), the number in the column to the right is 0.
If they select "Credit card (3% fee), the number in the column to the right is the Invoice Total x 3%
Here is the formula I'm using (everything is calculating correctly except the Invoice Total x 3%):
var v = this.getField("PaymentMethod").valueAsString;
if (v=="CHOOSE ONE") event.value = "0";
if (v=="Wire (no fee)") event.value = "0";
if (v=="Credit Card (3% fee)") event.value = (AmountInvoice_Total*.03);
Copy link to clipboard
Copied
When you use AmountInvocie_Total in your last line you need to identify the field:
this.getField("AmountInvoice_Total").value
Unless you have already created a variable from that field and you're not showing it in your script. Also:
1) Is the calculation order correct?
2) Is "Commit select value immediately" check in the options tab of the dropdown?
If you set export values in the dropdown you don't need an 'if' statement. Example:
event.value=this.getField("AmountInvoice_Total").value * this.getField("PaymentMethod").value;
Copy link to clipboard
Copied
When you use AmountInvocie_Total in your last line you need to identify the field:
this.getField("AmountInvoice_Total").value
Unless you have already created a variable from that field and you're not showing it in your script. Also:
1) Is the calculation order correct?
2) Is "Commit select value immediately" check in the options tab of the dropdown?
If you set export values in the dropdown you don't need an 'if' statement. Example:
event.value=this.getField("AmountInvoice_Total").value * this.getField("PaymentMethod").value;
Copy link to clipboard
Copied
Thank you so much I got it to work!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more