0

After applying Suitescript I am trying to deploy my user event script on vendor form but I always got "MODULE_DOES_NOT_EXIST" error.

ERROR STATEMENT: {"type":"error.SuiteScriptModuleLoaderError","name":"MODULE_DOES_NOT_EXIST","message":"Module does not exist: /SuiteScripts/AddFilterButton.js","stack":[]}

enter image description here

Here is SuiteScript:

/**
@NApiVersion 2.0
@NScriptType UserEventScript
@NModuleScope SameAccount
*/
define(['N/ui/serverWidget','N/log'], function (serverWidget,log) {

    function beforeLoad(context) {
        try{
            if (context.type === context.UserEventType.VIEW) {
                var form = context.form;
                
                var customButton = form.addButton({
                  id: 'custpage_filter_button',
                  label: 'Filter Button',
                });
                
                customButton.isDisabled = false;
                
            }
        }catch(ex){
            log.error({
                title: "Error",
                details: ex.message
            })
        }
    }

    return {
        beforeLoad: beforeLoad
    };
});
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
  • as I understood, you are having this when you try to deploy. So probably there is no file /SuiteScripts/AddFilterButton.js. At least I'd look into that direction – d.k May 26 '23 at 01:34
  • You said you have deployed the script on the vendor form. Have you tried deploying the script at a global level? I.e. Via SETUP > CUSTOMISATION > SCRIPTING? – Arif WB May 26 '23 at 09:07
  • Also - I see a difference between the error message in your screenshot and what you have shared. "Module does not exist: /SuiteScripts/AddFilterButton.js" .... on the screenshot, the file points to "/SuiteScripts/Filter_Button.js". Little confusing. Which one is it? AddFilterButton.js OR Filter_Button.js? – Arif WB May 26 '23 at 09:10
  • Thank you so much @Dmity for pointing out that I missed the AddFilterButton.js file when reviewing my SuiteScript directory. After investigating the SuiteScript directory, I realized that I did miss the AddFilterButton.js file in my directory. – usman ashraf May 26 '23 at 16:13

0 Answers0