Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

Acrobat Forms - Calculations

Community Beginner ,
Nov 09, 2019 Nov 09, 2019

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? 

TOPICS
PDF forms
3.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Nov 11, 2019 Nov 11, 2019

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.

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 10, 2019 Nov 10, 2019

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 10, 2019 Nov 10, 2019

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". 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 11, 2019 Nov 11, 2019

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 11, 2019 Nov 11, 2019

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 11, 2019 Nov 11, 2019

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 11, 2019 Nov 11, 2019

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? 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 11, 2019 Nov 11, 2019

How did you set up the calculations in those fields, exactly?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 11, 2019 Nov 11, 2019

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 11, 2019 Nov 11, 2019

Yes, that option will work with those field names, but the second option in the Calculate tab will not.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 11, 2019 Nov 11, 2019

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. Screen Shot 2019-11-11 at 11.59.50 AM.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 11, 2019 Nov 11, 2019

Just tried it using the same field names and it worked fine...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 11, 2019 Nov 11, 2019

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? 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 11, 2019 Nov 11, 2019

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 11, 2019 Nov 11, 2019

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! 🙂

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 15, 2024 Apr 15, 2024
LATEST

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. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines