Reputation: 1341
I am trying to reference a custom user module in a SS2.0 index script like so:
/**
* @NApiVersion 2.x
* @NScriptType Restlet
*/
define([
'N/record', 'N/error', "SuiteScripts/MyFolder/src/My_Controller", 'N/crypto',
Which works fine in sandbox. However when we deploy to production (bundle push) we get the following error when we call a RESTlet method:
You do not have permission to load this module SuiteScripts/MyFolder/src/My_Controller.js, it has an @NModuleScope of SameAccount which restricts its availability to customization objects created in account 1234566
All we did was:
Can anyone see what we are doing wrong? Thank you
Upvotes: 2
Views: 5095
Reputation: 403
You are correct, you are missing "@NModuleScope Public". See https://netsuite.custhelp.com/app/answers/detail/a_id/49326
You can set the argument to any of Public, TargetAccount or SameAccount. This allows you some control over what other scripts can load your module. If you do public, any bundle can run the script. If you want to avoid this, you can leave it to SameAccount and make sure your My_controller.js is in the same bundle as the restlet.
Upvotes: 3