ExploreConsulting / netsuite-fasttrack-toolkit-ss2

NFT for SuiteScript 2.X
74 stars 20 forks source link

autologger breaks with indirect beforeLoad #10

Closed ShawnTalbert closed 4 years ago

ShawnTalbert commented 6 years ago

if beforeLoad() exists on an indirect script (e.g. a form that does a lookup of some other record type) NS breaks something. Workaround is to not export beforeLoad() or make it en empty function.

You'll get an error like:

"type":"error.SuiteScriptError","name":"TypeError","message":"Cannot read property \"getMethod\" from undefined","stack":["createError(N/error)","<anonymous>(/SuiteScripts/ExploreConsulting/SS2/NFT-SS2-2.1.1/EC_Logger.js:152)","<anonymous>(/SuiteScripts/ExploreConsulting/SS2/NFT-SS2-2.1.1/aop.js:76)","createError(N/error)"],"cause":{"message":"Cannot read property \"getMethod\" from undefined","fileName":"/SuiteScripts/ExploreConsulting/SS2/NFT-SS2-2.1.1/EC_Logger.js","lineNumber":152,"name":"TypeError","stack":"\tat /SuiteScripts/ExploreConsulting/SS2/NFT-SS2-2.1.1/EC_Logger.js:152\n\tat /SuiteScripts/ExploreConsulting/SS2/NFT-SS2-2.1.1/aop.js:76\n\tat INVOCATION_WRAPPER$sys:27\n\tat INVOCATION_WRAPPER$sys:19\n\tat INVOCATION_WRAPPER$sys:37\n\tat INVOCATION_WRAPPER$sys:1\n","rhinoException":"org.mozilla.javascript.EcmaError: TypeError: Cannot read property \"getMethod\" from undefined (/SuiteScripts/ExploreConsulting/SS2/NFT-SS2-2.1.1/EC_Logger.js#152)"},"notifyOff":false}
ShawnTalbert commented 5 years ago

I think this may be a NetSuite bug behind the scenes that we may want to workaround

ShawnTalbert commented 4 years ago

This appears to be fixed in SuiteScript 2.1. I tested via a Suitelet that loaded an record with a UE script that had beforeLoad() autologging. Autologging in both scripts worked fine. Reopen if it pops up again.

MUBUSHER commented 3 years ago

I'm getting the same error any idea how can I resolve this

ShawnTalbert commented 3 years ago

The generic TypeError here is unrelated to the issue you describe in the NetSuite slack. Please see my comments there for more advice :)