title: NetSuite RESTlet Error code: INVALID_RETURN_DATA_FORMAT
body: <p>I'm attempting to call a saved search through the RESTlet API and I have my RESTlet deployed, but when attempting to run it, I'm getting the following error:</p>
  <blockquote>
  <p>error code: INVALID_RETURN_DATA_FORMAT</p>
  <p>error message:Invalid data format. You should return TEXT.</p>
  </blockquote>
  <p>Looking through my script, I can't identify where the error is. Below is the script that I'm attempting to run</p>
  <pre><code>function GetSearchResult(){
      //array container for search results
      var output = new Array();
      
      //get search results
      var results = nlapiSearchRecord('transaction','customsearchid',null,null);
      var columns = results[0].getAllColumns();
      
      //loop through the search results
      for(var i in results){
          //create placeholder object place holder
          var obj = new searchRow(
            //set the values of the object with the values of the appropriate columns
            results[i].getValue(columns[0]),
            results[i].getValue(columns[1]),
            results[i].getValue(columns[2]),
            results[i].getValue(columns[3]),
            results[i].getValue(columns[4]),
            results[i].getValue(columns[5]),
            results[i].getValue(columns[6]),
            results[i].getValue(columns[7]),
            results[i].getValue(columns[8]),
            results[i].getValue(columns[9]),
            results[i].getValue(columns[10]),
            results[i].getValue(columns[11]),
            results[i].getValue(columns[12])
            );
          
          //add the object to the array of results
          output.push(obj);
      }
      
      //return the array of search objects
      return output;
  }
  
  //Object to serve a place holder for each search row
  function searchRow(internalid,lineid,subsidiaryid,locationid,departmentid,accountid,date,name,memo,amount,uniqueid,product,period){
      this.internalid = internalid;
      this.lineid = lineid;
      this.subsidiaryid = subsidiaryid;
      this.locationid = locationid;
      this.departmentid = departmentid;
      this.accountid = accountid;
      this.date = date;
      this.name = name;
      this.memo = memo;
      this.amount = amount;
      this.uniqueid = uniqueid;
      this.product = product;
      this.period = period;
  
  }
  </code></pre>
  <p>Thanks!</p>