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?
Snippet of code to add button
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()"});
}Snippet of custom Module
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
       }
      })
 }
 }); 
     
     
     
    