RE: How to force NetSuite to “get” a script’s API version (2.x -> 2.1) update?
Hi all,
We’ve updated all the scripts in the SuiteApp we’re developing to 2.1 syntax recently – and changed the @NApiVersion JSDoc tag in the script files accordingly: from 2.x to 2.1.
However, on releasing this, we get reports from customers who claim that when they upgrade, NetSuite UI continues showing 2.0 as the API VERSION on the Customization -> Scripting -> Scripts page, for at least some of the scripts (as in the screenshot below). What’s worse, this causes NetSuite to throw an error whenever a 2.1 syntax is encountered in one of them, essentially making our SuiteApp unusable…
We’re quite baffled over this, and can’t reproduce the behavior in our testing accounts. Would anyone know what may be causing this, if there’s any setting to check, or how to remedy the situation? Our suspicion so far goes in the direction of an internal NetSuite bug.
Thanks!
If anyone else encounters this really strange error, this is how we ended up fixing it: for each script affected by this, we went to its XML “script object” file (as described e.g. here: https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_160321147201.html) and changed the scriptid attribute. This also forces a rename of the XML file, as they need to be equal (besides the .xml file extension). Note that you may have some references to the scriptid in the code as well (grep the codebase to find out) – these obviously need a rename too.
We think this remediates the issue because NetSuite treats such a rename as one script being deleted and another one being created – and since the one “being created” has @NApiVersion 2.1 from the start – it finally “gets” it. Phew…
