This topic contains 2 replies, has 0 voices, and was last updated by cblackburn 6 years, 10 months ago.

  • Author
    Posts
  • #18184

    JohnCCole

    I don’t know if this is possible, it seems that it should be but I can’t find in the documentation how I can refer to a custom SuiteScript 2.0 module I’ve created in the ClientSide of a Suitelet.

    The custom module has some configuration data I want to use both on the client side and server side of the Suitelet. Server side no problem I can include my custom module in the define function of my suitelet, but I’m at a loss how I could take advantage of the same custom module on the client side.

    The define statement of the custom module is creating an object but if I include a link to the javascript file in the Suitelet on the client side how would I invoke any attributes or methods of that custom module.

    I appreciate any help anyone can provide.
    This is a cached copy. Click here to see the original post.

  • #18185

    JohnCCole

    I think I got it, please correct if I’m wrong this seems to do what I want.

    Code:
    var custModule = null;
    require([‘/SuiteScripts/path_to_module.js’], function (module)
    {
    custModule = module
    });

  • #18186

    cblackburn

    Hi John, if you are using the N/ui/serverWidget module to construct the page (Form/List/Assistant) you can set the client script entrypoint module for the custom page by setting the “clientScriptModulePath” attribute of the Form/List/Assistant. In the case of Form, it will automatically bind to the client script entrypoint contract if it is implemented on the specified client side module, so for example, if the “suiteletClientScript” module below has a “pageInit” function, it would be called when the Suitelet Form is rendered in the browser.

    form.clientScriptModulePath = ‘/SuiteScripts/suiteletClientScript’; https://system.netsuite.com/app/help…625445350.html

You must be logged in to reply to this topic.