Hey guys, I'm getting the error "NO_PERMISSION_TO...
# suitescript
m
Hey guys, I'm getting the error "NO_PERMISSION_TO_MODULESCOPE_SAMEACCOUNT_MODULE" even though the script it mentions in the error has the modulescope of public. anyone have any tips to get this working?
b
first off, you basically never want to choose 2.x
its either 2.0 or 2.1
secondly, you need to share the inputs to the define function
that error can also apply to the dependencies, and is actually extra likely to be the cause when working with 2.1 and custom modules
m
2.1, 2.0 does not make a difference but i will keep it on 2.1 for you
define is:
b
looks normal
is this an actual client script, or is this being used by a suitelet
m
maybe relevant is that this error only happens when creating try to create a return authorization using a script which is included in a bundle
so yes, correct it's called from a suitelet
this is the suitelet:
and the script is locked:
b
you shouldnt be using the jsdoc at all then
m
can you explain? jsdoc is the comment with @nmodulescope?
b
jsdoc are the comments inbetween /** */
m
unfortunately the same error occurs when removing the jsdoc comments completely
b
2.1 does not parse the docs the same as 2.0
it basically assumes SameAccount
m
so how would you go about getting this to work?
in 2.0 it gives the same error btw
b
use 2.0 everywhere
only include
Copy code
/**
 * @NModuleScope Public
 */
in your jsdoc
m
unfortunately the script that includes this module can only use 2.1 because i use the new features there
it is possible to get this to work in 2.1?
b
depends on which features you are using
m
for example the arrow function syntax
b
nope, arrow function requires the suitescript parser to understand arrow functions
you can try going through support, but this issue has existed since 2.1 was beta
its here to stay
you dont want to include any jsdoc that tells netsuite to parse the file as suitescript
Copy code
/**
 * @NModuleScope Public
 */
dont include the NApiVersion, or if you do, only choose values to are equivalent to 2.0
dont include the NScriptType, which is usually a dealbreaker, but will work fine for the client script used in a suitelet
its not needed, and actually is undesirable if you are only including a button, declaring the NScriptType forces you to include a valid entry point
m
i will give it a go, thanks