Copy link to clipboard
Copied
I have 4 fields
field1 is the begining balance
field2 is amount collected (i want to add this to the field1)
field3 is refunds (i want to subtract that from the total of the first two)
field4 is checks written (again I want to subtract this from the top three)
field5 is where I want the ending balance to go
How do I write this. Do I use script or simplified?
Copy link to clipboard
Copied
You can use the simplified calculation script of field5, like this (if I understood you correctly):
(field1 + field2) - (field3 + field4)
Copy link to clipboard
Copied
I just tried that. But the number is not showing up. It is not giving me an error. I recopied all the field names. They don't have any spaces in them. Should their be spaces between the + and the - in your equation?
Copy link to clipboard
Copied
Spaces are not necessary, but might be helpful.
Check the JS Console for errors (Ctrl+J). Also, keep in mind the script will only "kick in" when you change the value of one of the fields after you enter it.
Copy link to clipboard
Copied
Thank helps with another problem. Thank you. I will look at the Ctrl+j.....
Copy link to clipboard
Copied
it gives me error messages that say field has not been defined. and missing : and ; before statment
Where do these go in the script equation?
Copy link to clipboard
Copied
That means you used the wrong field name. Keep in mind that JS is
case-sensitive, so if the field is called "Text1" you can't use "text1"...
Find more inspiration, events, and resources on the new Adobe Community
Explore Now