Bruce Backman
07/26/2024, 5:14 PMerictgrubaugh
07/26/2024, 5:18 PM2.x
, and to be explicit about the version they're writing, especially if the code is being distributed to multiple environments where 2.x is never guaranteed to be interpreted the same.
Share the stub and the full versions for better analysis.Bruce Backman
07/26/2024, 6:37 PMlet
statements in the script. The target system is configured to treat 2.x as 2.1, for what that's worth
Setting the script version to 2.1 allowed the script to deploy with the let
statements, so that at least was nice. I still have a bit of PTSD from the one time I deployed a 2.1 script, someone subsequently enabled SuiteTax in that account which was incompatible and caused all 2.1 scripts in that system to crash. Hopefully that's fixed now that SuiteTax is enabled by default.
If I intend to write 2.0 and specify 2.0, but accidentally stray out of bounds and use something like a let
statement, it sure would be nice if the error message referred to language or syntax in some way. That would have saved me about 12 hours of trial and error. Playing with the version might provide a useful data point for people -- when you get a nonsense error message, try specifying 2.1 and if that makes it go away you should try to make your script look more old fashioned.
The script editor in the NetSuite UI does indicate "Syntax error: missing ; before statement" when you try to use a let
statement in a script that's marked 2.0. It doesn't tell you what line the error is on, though, so it isn't that much more useful.