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

Fillable calculations not working, well, some do, some don't

Enthusiast ,
Jul 01, 2023 Jul 01, 2023

I am about to scream over an order sheet project. It came into Acrobat as a two-page pdf from an excel-sheet. The pages have 36 records each. The fields for calculation are a number ordered, generally named for the product, a by-the-case price which also may contain the product name and a total field where the calculation is done.

 

I have finished the product ordered / price calculations on the first page, but there are six total fields that I cannot for the life of me get to return a properly calculated total. I get this error message when I do control-j in the calculated field:

TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool

 

As I understand it, this means the formula is looking for something it thinks it needs and cannot find or words to that effect. That said, I have created new text boxes and given them new names, have copied successful fields and renamed - I've had limited success on that. I even went so far as to name one of the product order fields "tom", and the case price field "dickandharry" and that did not work. I also have a script kindly provided by a commentor and it works, but not all the time.

 

I have started on the second page and got five records to work properly and then the non-working issue popped up again.

 

Since it is full of proprietary pricing information, I am somewhat reluctant to post it on this board but can upload it to my secure site for an interested individual to see, download and tell me what to do or fix it and send me a bill. Can someone help? I am open to all suggestions.

Thanks to those who know more than me,

Joe

TOPICS
How to , JavaScript , PDF forms
1.6K
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 ,
Jul 02, 2023 Jul 02, 2023

I'm happy to take a look. Send me a PM with the details of how to access 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
Enthusiast ,
Jul 02, 2023 Jul 02, 2023

Info sent via PM Thanks!

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
LEGEND ,
Jul 02, 2023 Jul 02, 2023

The most common cause of this error (though it is very general and has other causes) is using the wrong field name with getField. For example, using getField("quantity") when the field is actually called Quantity or QUANTITY.  I think it's also telling you that the error is on line 1282. Maybe you could share line 1282 and the few lines before it if you can't share the file.

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 ,
Jul 02, 2023 Jul 02, 2023

Actually, the line number and location ("byteCodeTool") indicate this is not an error with a custom script but with a selection in the built-in Sum/Product/etc. options, or the Simple Field Notation one.

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
LEGEND ,
Jul 02, 2023 Jul 02, 2023

Thanks for that, I thought "byteCodeTool" looked a little strange.

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 ,
Jul 02, 2023 Jul 02, 2023

Reporting the "byteCodeTool" is new.  I just noticed this with some customers a few weeks ago at most.  

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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 ,
Jul 02, 2023 Jul 02, 2023

If you're experiencing issues with fillable calculations, where some work while others don't, there may be several possible causes for this inconsistency. Here are a few troubleshooting suggestions:

  1. Check the formula: Review the calculations in the fillable fields that are not working correctly. Ensure that the formulas are correctly entered, including proper syntax, referencing the correct cells or values, and using the appropriate mathematical operators.

  2. Confirm data types: Verify that the data types of the input values are compatible with the calculations. For example, if a calculation involves dividing by a number, ensure that the divisor is not zero, as it can lead to errors or unexpected results.

  3. Validate cell formatting: Ensure that the cells involved in the calculations are formatted correctly. For instance, if a cell is formatted as text instead of a numerical format, it may interfere with calculations. Adjust the formatting if necessary.

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 ,
Jun 27, 2025 Jun 27, 2025

This is what I've found since the "Cloud" has been in extensive use by folks.  I develop lots of Adobe Pro Dc forms with extensive formulas.  If this file is sent from the Cloud/Google Drive/One Drive, the formulas do not work correctly *and* if the file is retrieved from Cloud/Google Drive/One Drive, the formulas will NOT work correctly.  However, if the file is saved/sent from your hard drive to another and the other party uses the form file from their hard drive, there are NO problems whatsoever and all the formulas work fine.  So what's the deal on this?  What is going on with Adobe Pro DC formulas seeming to not be compatible with the Cloud/Google Drive/One Drive?   We know this is the issue, because we have tested it and it IS only when these are sent, retrieved, or saved to the Cloud/Google Drive/One Drive.  Why is this happening?   Thanks. 

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 ,
Jun 30, 2025 Jun 30, 2025
LATEST

The sensible assumption would be that One Drive is not just storing the file, but modifying it. I suspect this has something to do with security settings, One Drive doesn't like JavaScript. To verify this, post a form that was saved and retrieved from One Drive, and we'll take a look at it. Post the file before and after. 

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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