Saurabh More
Saurabh More

Reputation: 413

suitescript 2.0 module does not exist error user event script

I am trying to run this suitescript 2.0 user event script but it always throws an error {"type":"error.SuiteScriptModuleLoaderError","name":"MODULE_DOES_NOT_EXIST","message":"Module does not exist: /SuiteScripts/Usr event 2.0.js","stack":[]}

the script code is /** *@NApiVersion 2.x *@NScriptType UserEventScript */ define(['N/record'], function(record) { function afterSubmit(context) {context.type == context.UserEventType.CREATE
var customerRecord = context.newRecord; var comm = customerRecord.getValue('comments') try { log.debug('Comments', 'Value: ' + comm); } catch (e){ log.error(e.name); } }return { afterSubmit: afterSubmit }; });

Upvotes: 4

Views: 1882

Answers (2)

Bebeto
Bebeto

Reputation: 59

Just add .js at the end of your suitescript name. As i observed multiple times.

Upvotes: 2

Saurabh More
Saurabh More

Reputation: 413

The issue was that i had not added .js extension to the script file. but now it is working after creating a new script adding the extension.

Upvotes: 2

Related Questions