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
        };
 });
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.
Just add .js at the end of your suitescript name. As i observed multiple times.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With