Copy link to clipboard
Copied
So I've created an Acrobat form, and I want to use the calculate feature for some of the fields, to enter the results into another field. And that's working great. But I also then want to calculate the total from that field plus another field, with results to end up in a third field. And I can't seem to get it to work.
Is it because one of the fields used in the calculation gets its total from other fields as opposed to direct input?
Copy link to clipboard
Copied
Yes, in my own file. I had a chance to examine your file more closely and I found the issue for this error.
Somehow (my guess is you created the fields in InDesign, not Acrobat), you were able to insert a space at the end of the field name of "Total OOP Write-Off Amount", which causes it not to be picked up by any scripts.
Remove that space and it should work correctly.
Copy link to clipboard
Copied
No, that should not be an issue. The only thing you have to make sure is that the calculation order is correct, ie that the total field is calculated after the fields it uses for its own calculation.
Please specify in what exact way it's not working and we'll help you further with this issue.
Copy link to clipboard
Copied
The first total field is working correctly, that is, grabbing the sum of figures entered into the input fields. That total field is then followed by another field, which the user needs to enter an amount into manually, and then the third total field should sum the values from the first and second fields. I Googled calculation order, but could not find where to adjust the calculation order in my version of Acrobat, which is Pro DC, latest version.
That third field is not resulting in a total of the prior two. It just remains at zero.
So I have essentially four types of fields. The results of the first group, up to seven different fields titled "Write-off amount", should sum together and the total lands in a field titled "Total Fee Write-Off Amount". This field is followed by a field titled "Total OOP Write-off Amount", which the user enters a value into, and then the final field should sum the totals from "Total Fee Write-Off Amount" and "Total OOP Write-off Amount".
Copy link to clipboard
Copied
The field calculation order can be set via Prepare Form - More - Set Fields Calculation Order.
I would recommend you check the JS Console (Ctrl+J) for error messages.
Also, if you could share the file with us we could help you fix the issues in it.
Copy link to clipboard
Copied
Ah, well, the "More..." option is right there, isn't it? I don't know why I didn't see it before. However, it looks like the calculation order is correct.
The Javascript console does give me errors:
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
Here's a Dropbox link to the file, I really appreciate the offer of assistance: https://www.dropbox.com/s/9k0yvwq3sxoqfst/WriteOffForm_L5_Interactive.pdf?dl=0
Copy link to clipboard
Copied
Because your field names contain special characters (like spaces and a hyphen) you need to use a calculation script instead of the Simple Field Notation option.
Copy link to clipboard
Copied
That's something I didn't know! What I'm not clear on, however, is why the results from filling in the fields on pages 2 through 4 end up where they're supposed to, even though those fields have spaces and a hyphen as well?
Copy link to clipboard
Copied
How did you set up the calculations in those fields, exactly?
Copy link to clipboard
Copied
With the "value is the sum" radio button in the calculate tab. And then selected all the fields I wanted it to pull data from for the Total Fee write-off amount.
Copy link to clipboard
Copied
Yes, that option will work with those field names, but the second option in the Calculate tab will not.
Copy link to clipboard
Copied
I haven't used the second option for any of them, just the radio button sum. So the final field "Total Write-off Amount" is supposed to pull in the values from "Total Fee Write-Off Amount" and "Total OOP Write-Off Amount", but it doesn't.
Copy link to clipboard
Copied
Just tried it using the same field names and it worked fine...
Copy link to clipboard
Copied
Really? From my file, or did you create your own? So you were able to get "Total Fee Write-Off Amount" and "Total OOP Write-Off Amount" to sum into "Total Write-Off Amount" (the third field in the gray bar)? Using the same settings as mine?
Copy link to clipboard
Copied
Yes, in my own file. I had a chance to examine your file more closely and I found the issue for this error.
Somehow (my guess is you created the fields in InDesign, not Acrobat), you were able to insert a space at the end of the field name of "Total OOP Write-Off Amount", which causes it not to be picked up by any scripts.
Remove that space and it should work correctly.
Copy link to clipboard
Copied
Ah!!!!! Yes, you are correct, I created the fields in InDesign. Renaming that field to remove the space at the end fixed it. Thank you so much! 🙂
Copy link to clipboard
Copied
I had this same problem in one field. I had dashes in the names of the calculating fields, and once I removed them, the formula worked fine.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more