Using @NAmdConfig

We can set up a custom module name to aid re-use. After configure a module name, we can require it without knowing the path.

Custom module loading by name also enables better interoperability with third-party libraries and may offer some protection against naming conflicts.


To load a custom module by name:

  • Create the module file
  • Create a json file with the module path specified in it. Then add each module’s path in the way shown below. An example is the screenshot that below.
  • Load the custom module in your SuiteScript 2.x script by including the NAmdConfig tag and passing the name to the define. Make sure to use the correct module name from the json file.

Leave a comment

Your email address will not be published. Required fields are marked *