Skip to main content
Inspiring
January 30, 2019
Question

Acrobat Pro 2017 Console / Debugger HELP!

  • January 30, 2019
  • 2 replies
  • 555 views

Hello

I am embarrassed to ask this question because I am self taught on JS and using the console for error debugging  - and I taught myself on Pro 9 -  however overnight,  my office has upgraded me to Pro 2017 and now I find the the console / debugger completely useless.  Instead of telling me which field has the issue, I now only see:

TypeError:  this.getField(..) is null

1:Field:Calculate

In the button I hit (which was a reset button) I have dozens of fields that are set to do certain things on reset - it used to say for example:

this.getField("HolderOne") is null

so I knew exactly where the issue was.  I kind of use it throughout the document and to test each execution as I create it.  I don't really work in the document level script, I use the properties to add my script in.

Could anyone possibly suggest how I can use this kind of error message to actually find my problem?  Do I have a setting wrong?  I lot of the time I am having a stab in the dark at getting a calculation script or something like that working and this was the only way I could get myself on the right track - by interpreting what was spat out on the console.

I have searched and searched all day all over the the net to try and find anything, but I can't see anything at all...

Please help if you can!!

This topic has been closed for replies.

2 replies

Thom Parker
Community Expert
Community Expert
January 30, 2019

The correct way to write code is to use error handling techniques, such as testing values that might be problematic and using exception handling.  It's also a good idea to test you code as it is being written.  Good debug tools are nice, but you shouldn't use them as a crutch for bad coding practices.

To that end, your problem appears to be an invalid field name. At some point you entered code that was incorrect to begin with. How many calculation scripts did you enter before testing?  The error will be in your latest set of updates.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
try67
Community Expert
Community Expert
January 30, 2019

This error message usually comes from the built-in Calculation functions (Sum, Product, etc.) and it is an excellent example of extremely poor error-handling by the Acrobat developers, as it fails to provide the most crucial bits of information:

1. Where the error happened? (under which field's calculation event)

2. What caused the error? (what was the invalid field name)

Inspiring
January 30, 2019

Thanks so much to you both.

Yes, @Thom absolutely agree I do not use it correctly - I definitely do use it as a crutch because this is not my line of work, just something I picked up on the side but I absolutely love it and wish I had the time to understand how to use it properly.  The documents I have created have been so well received within my firm.  Things like being able to combine 4 forms into one using layers and customise submissions to various departments has been awesome, but I have definitely come to rely on those specific error messages to help me work out where I messed up.

@try67 - also couldn't agree more - there is zero information in that kind of error message - and I am guessing that is not going to change anytime. I know where that particular error is - more for example purposes - but with my situation and lack of knowledge here its kind of a deal breaker.  Might need to get them to roll me back to 9 because I absolutely rely on the built in functions and this is a 20 page application form with a data collection section at the top which then populates the rest so there is LOADS of stuff in it.

Anyway, thanks to you both - appreciate you taking the time to get back to me.  I can now stop trawling the internet for a solution I shall not find!!!

try67
Community Expert
Community Expert
January 30, 2019

Unfortunately, this is indeed a serious issue with the functionality of Acrobat DC, especially for developers.

The only solution is to use your own code to perform all calculations and add specific error messages with the field-name when this situation happens.