Discussions
Join us for complimentary one-day events around the world and step into a future fueled by AI and limitless potential. Explore new breakthroughs, sharpen your skills, and connect with experts who are shaping what’s next. Experience bold keynotes, interactive learning, and connections that span the global NetSuite community. Discover what's next at SuiteConnect Tour 2026.
custom module: TypeError: Cannot find function libTest1 in object [object Object]
I created a simple custom module to get an example working to pull into a RESTlet. I keep getting the error, org.mozilla.javascript.EcmaError: TypeError: Cannot find function libTest1 in object [object Object] when calling a function in my custom module. I am not sure how to get around this error, any ideas?
Custom Module:
/**
* TestModule.js
* @NApiVersion 2.x
* @NModuleScope SameAccount
*/
define([], function(){
function test1(){
return 'hi';
}
return {
libTest1 : test1
}
});
RESTlet:
define(['N/record', 'N/error', './TestModule'],
function(record, TestModule) {
/**
* Function called upon sending a GET request to the RESTlet.
*
* @param {Object} requestParams - Parameters from HTTP request URL; parameters will be passed into function as an Object (for all supported content types)