Reputation: 115
I'm trying to execute the suite script2.0 user event
/**
*@NApiVersion 2.0
*@NScriptType UserEventScript
*/
define(["N/record"], function (r) {
function onAfterSubmit(context) {
}})
but while uploading the js file in net suite
It's not allowing to upload the 2.0 js file
i'm getting define no defined error..
thanks in Advance!
Upvotes: 1
Views: 1744
Reputation: 11
This is an annoying thing that I have run into with 2.0, but it is because your name on the Script File needs to end in ".js" This should fix it
Upvotes: 1
Reputation: 139
Your code isn't being recognized as SS2. You need a space between the *
and the @N...
in the JSDoc
/**
* @NApiVersion 2.x
* @NScriptType UserEventScript
* @NModuleScope SameAccount
*/
define(['N/record'],
function(r){
function onAfterSubmit(context){
log.debug('After Submit Triggered');
}
return {
afterSubmit: onAfterSubmit
};
});
Upvotes: 4