title: NetSuite SuiteScript 2.0 How to pass parameter from Main Suitelet to Custom Modules
body: <p>I am a Javascript / PHP / Python developer for 25 years, and recently was hired as a NetSuite SuiteScript Javascript Developer.</p>
  <p>NetSuite has very peculiar ways of doing things, so I must do things the NetSuite way.</p>
  <p>Since NetSuite advises best practice of modular software architecture, this is what I am doing.</p>
  <p>I have a main Suitelet script that is scaling to include one custom module with one function for each individual functionality.</p>
  <p>I have created a custom Search, and I need to pass these results to various custom modules for further processing.</p>
  <p>For example, I want to pass this &quot;ListOfVendors&quot; to a UI module that will contain this dynamic data in a MULTISELECT box.</p>
  <p>I have tried to just pass this variable as an object, but in the module log it is showing up as not being passed,i.e. NULL.</p>
  <p>The NetSuite ecosystem complicates things, so how do I pass this variable to another custom module?</p>
  <p>Thanks.</p>
  <pre><code>/**
   *@NApiVersion 2.1
   *@NScriptType Suitelet
   *@NModuleScope SameAccount
   */
   
   define(['N/log',
      './mod_search4vendors',
      './mod_ui'],
  
      function (log, mod_search4vendors, mod_ui) {
  
          // BEGIN ENTRY POINT FUNCTION #1
          function fn_EntryPointFunction1(context) {
  
              var ListOfVendors = mod_search4vendors.fn_Search4Vendors(context);
  
              var TEST_PASS_VARIABLES = mod_ui.fn_cr8_sublist(context);
  
          }
          // END ENTRY POINT FUNCTION #1
  
          return {
              onRequest: fn_EntryPointFunction1
          };
      }
  );
  </code></pre>