title: Returning a Value from a Suitelet popup to a Client Script
body: <p>Looking for some assistance on how to return a value from a Suitelet popup to a client script.</p>
  
  <p>I have a client script triggered by a field change which executes the suitelet:</p>
  
  <pre><code>var url = nlapiResolveURL('SUITELET', 'customscriptnbi_weeklytimesheet_suitelet','customdeployso_lineselectionpopupsuitele',false);
  var resp = window.open(url,'_blank','width=300,height=300,titlebar=0,status=no,menubar=no,resizable=0,scrollbars=0');
  </code></pre>
  
  <p>On the Suitelet, how can I "write" the response back to the client script:</p>
  
  <pre><code>    if (request.getMethod() == 'GET' ) {
          var form = nlapiCreateForm('Select Sales Order Line',true);
          form.setScript('customscriptnbi_weeklytimesheet_slet_cs')
          form.addSubmitButton('Set');
          response.writePage(form);
      } // END 'GET' METHOD
      else {
  
  
          response.write('&lt;html&gt;&lt;body&gt;&lt;script&gt;window.parent.close(); &lt;/script&gt;&lt;/body&gt;&lt;/html&gt;');
      } // END 'POST' METHOD
  </code></pre>
  
  <p>any assistance would be much appreciated.</p>