using import and that worked but wondered if there's a NetSuite preferred way
c
Carlos J. Garcia
11/12/2019, 2:48 PM
So far I've been able to import files into NS scripts using the define, but keep in mind netsuite is ES 5.1
j
JohnnyC
11/12/2019, 2:52 PM
Yeah I know it's 5.1, but SS 2.1 I've heard reports supports features up to ES 10. Worst case I'll just do what I've done. It's a utility class that really has nothing to do with NetSuite objects and will always be run client side. Naturally I want a SuiteScript file to call methods on this class, so for now in my script module I'll just put the class on the window object.
c
Carlos J. Garcia
11/12/2019, 2:55 PM
I wouldn't go with 2.1 yet, since it's still on beta and like you say, they could support some modules from ES10 but for now I'd try to make it safer, if it's a utility class you can later upgrade it to use certain functionalities.. I'm still outrageous about using indexOf to search in arrays
j
JohnnyC
11/12/2019, 2:57 PM
Thanks Carlos
s
suitedev
11/12/2019, 3:42 PM
I can't think of any reason not to use it if it's a client side script.