Copy link to clipboard
Hi! I'm trying to do a very simple calulation using 3 fields to populate a 4th field, but I can't get anything to work.
Field Name = "Base Fee 1"
Field Name = "Previously Invoiced 1"
Field Name = "Current Invoice 1"
I'm trying to subtract the Previously Invoiced and the Current Invoice from the Base Fee to calculate the Remaining Fee. This is what I've tried or things similar to it:
var a = this.getField("Base Fee 1").value;var b = this.getField("Previously Invoiced").value;var c = this.getField("Current Invoice").value;var d = a-b-c;event.value = d.value;
Do you need to start with the brackets or function start or anything like that? I'm very new to all this so I'm just trying to piecemeal things I've found googling.
Thanks for your help!
Here is a basic tutorial on calculation scripts. It is pretty old but the info is still valid.
Unfortunately Adobe decided to not keep the download sample file that went with the tutorial.
Hope this helps,
event.value = d.value;
event.value = d;
Also make sure you have right field names,you write that your fields are "Previously Invoiced 1" and "Current Invoice 1" but in your script there is no number 1 on those fields.