title: Suitescript 2.0 addButton
body: <p>I have a suitelet with a sublist button and I am trying to get the button to execute a function on a custom module.  I can not get it to work. I get an error "Cannot call method "receive" of undefined" 
  Any Ideas?</p>
  
  <p>Snippet of code to add button
  <div class="snippet" data-lang="js" data-hide="false" data-console="true">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>define(['N/error', 'N/record', 'N/search', 'N/ui/serverWidget','./lib1'],
  
  
  function(error, record, search, ui, lib1) {
  //... some code here
  searchSublist.addButton({
     id: 'custpage_recievepayment', 
     label: 'Receive Payment',
     functionName: "lib1.receive()"});
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Snippet of custom Module</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>define(['N/redirect'],
    function(redirect){
   function receive(){
  
        var deal = '497774';
        var url = redirect.toSuitelet({
         scriptId: 'customscript_deal_entry_2_0',
         deploymentId: 'customdeploy1',
         returnExternalUrl: false,
         params: {
          prevdeal: url
         }
        })
   }
   });</code></pre>
  </div>
  </div>
  </p>