title: NetSuite SuiteScript 2.0 Adding additional filters to a loaded saved search erroring with WRONG_PARAMETER_TYPE
body: <p>I have the following SuiteScript 2.0 code in a Suitelet where I would like to add an additional filter to the loaded saved search (inventory items sublist and main record of the Inventory Adjustment record):</p>
  
  <pre><code>  var rs = s.load({
      id: "customsearch_inv_adj_item_search"
    });
  
    // Copy the filters from rs into defaultFilters.
    var defaultFilters = rs.filters;
    var customFilters = [
       s.createFilter({
          name: "internalid",
          operator: s.Operator.IS,
          values: request.parameters.custscript_report_context.toString()
       }),
    ];
  
    // Push the customFilters into defaultFilters.
    defaultFilters.push(customFilters);
  
    // Copy the modified defaultFilters back into rs
    rs.filters = defaultFilters;
  
    var results = rs.run().getRange(0, 1000);
  </code></pre>
  
  <p>However the code keeps on failing on the line <code>rs.filters = defaultFilters;</code> with the error:</p>
  
  <pre><code>{"type":"error.SuiteScriptError","name":"WRONG_PARAMETER_TYPE","message":"Wrong parameter type: filters[2] is expected as Filter. ","stack":["createError(N/error)","onRequest(/SuiteScripts/sui_custom_pdf_report.js:308)","createError(N/error)"],"cause":{"name":"WRONG_PARAMETER_TYPE","message":"Wrong parameter type: filters[2] is expected as Filter. "},"id":"","notifyOff":false,"userFacing":true}
  </code></pre>
  
  <p>Instead of <code>request.parameters.custscript_report_context.toString()</code> I have tried <code>981, "981", ["981"]</code> but no luck.</p>
  
  <p><code>custscript_report_context</code> is of type integer and it works fine in trying to load the record via <code>N\record</code>.</p>
  
  <p>I am returning <code>internalid</code> in my saved search as a column.</p>
  
  <p>Does anyone know what I'm doing wrong?</p>