Discussions
Tip: NetSuite will call your static methods
I'm always trying to avoid globals wherever I can, they can introduce very hard to find bugs when you stomp on another piece of code because of name conflicts, don't promote well organized code and make it more difficult to separate subsystems from one script file into another (when we have support for multiple files... hint hint NetSuite)
This might not be news but I wasn't sure if it work so I tried specifying a static object method in the script record and it works.
So instead of just have a global method: OnInit() you can have MyObjectName.OnInit
If your client object is stateful and requires an instance to function correctly you can still define static "entry point" methods that call instance methods internally.
Steve Klett | Senior Developer
NetValue Technology