Skip to main content
Inspiring
April 25, 2019
Answered

Which field is my javascript error in?

  • April 25, 2019
  • 3 replies
  • 1814 views

TypeError: f is null

1051:byteCodeTool

That's the error I'm getting. The main problem is I have 88 fields being calculated. Is there a way to more easily find the source of this than to dig through each field?

This topic has been closed for replies.
Correct answer try67

Go to Edit - Preferences - JavaScript and select an external editor, like Notepad.exe ...

3 replies

JR Boulay
Community Expert
Community Expert
April 26, 2019

I always keep Acrobat 9 Pro on my Mac for 2 reasons:

- The JavaScript Console of Acrobat 9 and older versions gives the field name source of error.

- It's faster and more efficient (no crash) for batch process.

I guess that Adobe Reader 9 should be enought to display errors in the JavaScript Console (don't forget to enable the debugger in JavaScript Preferences).

Acrobate du PDF, InDesigner et Photoshopographe
Thom Parker
Community Expert
Community Expert
April 25, 2019

So "f" must be script variable that is set from "getField"? And you use it in the custom calculation script in all 88 fields? 

Or, are you using simplified field notation for the calculation? I ask this because the error is reported on line 1051 of a script called the "byteCodeTool".  This implies there is an error in translating code.  This is important for understanding the context of the error.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
BarlaeDC
Community Expert
Community Expert
April 25, 2019

HI,

With the form open, search the tools for "All JavaScripts", this will open every JavaScript in the document in one file, DO NOT CHANGE this as it is very easy to break the document. Once you have located what you think is the problem you should go to the form field and make the change there.

Regards

Malcolm

Inspiring
April 25, 2019

Sadly, that gives me a popup.

Text cannot be display in full by the Edit Dialog.

Please use an External Editor.

Not an overly helpful popup.

Oh, and javascript, lots of javascript. Large arrays and for loops, mostly.

Thom Parker
Community Expert
Community Expert
April 25, 2019

Did you create this form and the scripts?

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