ericbirdsall
11/20/2020, 7:29 PM@NAmdConfig
path? Such as /SuiteScripts/JsLibraryConfig.json
?
/**
* @NApiVersion 2.x
* @NScriptType usereventscript
* @NAmdConfig ./JsLibraryConfig.json
*/
stalbert
11/20/2020, 7:46 PM@NAmdConfig
due to it's top-level limitation.ericbirdsall
11/20/2020, 7:51 PMstalbert
11/20/2020, 7:54 PMericbirdsall
11/20/2020, 7:57 PMbattk
11/20/2020, 7:58 PMericbirdsall
11/20/2020, 7:58 PMbattk
11/20/2020, 8:00 PM/**
* @NApiVersion 2.1
* @NScriptType Suitelet
* @NAmdConfig /SuiteScripts/config.json
*/
define(["lib"], function (lib) {
return {
onRequest: function onRequest(context) {
log.debug("context", context);
lib.loggingFunction();
},
};
});
battk
11/20/2020, 8:01 PM{
"paths": {
"lib": "./library.js"
}
}
battk
11/20/2020, 8:01 PMdefine([], function () {
return {
loggingFunction: function () {
log.debug("im a log", "from a library");
},
};
});
ericbirdsall
11/20/2020, 8:10 PM{
"paths": {
"css_library": "/SuiteScript/cssLibrarySS2.js"
}
}
cssLibrarySS2.js file in SuiteScripts folder
/**
*@NApiVersion 2.x
*/
define(['N/ui/dialog'], function (dialog) {
function popUp(someString) {
var options = {
title: 'Notice',
message: someString
};
dialog.create(options);
}
return {
popUp: popUp
}
});
ericbirdsall
11/20/2020, 8:12 PM/**
*@NApiVersion 2.x
*@NScriptType ClientScript
*@NAmdConfig /SuiteScripts/libraries.json
*/
define(["css_library"], function (cssLibrary) {
function pageInit(context) {
cssLibrary.popUp("cool string");
}
return {
pageInit: pageInit
}
});
Get Error:
Fail to evaluate script: {"type":"error.SuiteScriptModuleLoaderError","name":"MODULE_DOES_NOT_EXIST","message":"Module does not exist: /SuiteScript/cssLibrarySS2.js","stack":[]}battk
11/20/2020, 8:13 PMericbirdsall
11/20/2020, 8:13 PMbattk
11/20/2020, 8:13 PMbattk
11/20/2020, 8:13 PMericbirdsall
11/20/2020, 8:15 PMericbirdsall
11/20/2020, 8:17 PMericbirdsall
11/20/2020, 8:17 PM{
"paths": {
"css_library": "/SuiteScript/cssLibrarySS2.js"
}
}
ericbirdsall
11/20/2020, 8:17 PMbattk
11/20/2020, 8:20 PMericbirdsall
11/20/2020, 8:20 PM