title: Workaround to search Netsuite Note record by Customer id
body: <p>I'm trying to get an app I'm working on to display all associated user notes for a given Customer record (as it appears on the UI Customer record page in Netsuite proper).</p>
  
  <p>To that end, I've set up a Netsuite RESTlet to return a list of internal ids for associated Note records given a Customer internal id.</p>
  
  <p>I've set up a simple search in the RESTlet script:</p>
  
  <pre><code>function get_notes(params) {
    log("GET params", JSON.stringify(params));
  
    var filters = [
      new nlobjSearchFilter('internalid', 'customer', 'is', params.id)
    ];
  
    var columns = [
      new nlobjSearchColumn('internalid'),
      new nlobjSearchColumn('note'),
    ];
  
    var search = nlapiCreateSearch('note', filters, columns);
    var notes = search.runSearch().getResults(0, 3);
    return notes;
  }
  
  function log(msg, details) {
    nlapiLogExecution('DEBUG', msg, details);
  }
  </code></pre>
  
  <p>The script works as expected, but the problem is that this search ONLY returns Notes for which the <code>author</code> field (which is a user internal id) matches the internal id of the user performing the search.  Meaning - you can only search for Notes for which you are the author.</p>
  
  <p>I have been informed that this is a 'feature' of Netsuite for some unfathomable security reason.</p>
  
  <p>I need to be able to get a list of all the associated Note ids, not just those for which the user making the request is the author.</p>
  
  <p>Any ideas on a workaround to get at all the associated Notes?  A different way to structure the search?  Some kind of secret way to define your own custom Search Joins?  </p>
  
  <p>I can't even find documentation on this behavior (blocking Note searches from non-authors). Perhaps someone knows how to override it at the admin level?</p>
  
  <p>I'm not quite ready to admit that this is impossible yet.</p>
  
  <p>NB: User Note is a Note-type record associated with the Customer record, not a field on Customer record, so I can't access it directly from Customer.  There is also not a Search Filter or Search Join for Note or User Note.</p>