title: ** SuiteScript 2.0 ** Error while creating search object in client script
body: <p>searchResultSet.columns.length --> undefined....</p>
  
  <p>what is missing in this code ? </p>
  
  <hr>
  
  <p>function pageInit(scriptContext) {</p>
  
  <pre><code>    try{  
      var currentRecord = scriptContext.currentRecord;
      var searchObj = search.load({
         id:'customsearchvc_bt_duplicate_vendor_list'
      });
  
      var searchResultSet=searchObj.run();
      var noOfDupVendors = searchResultSet.length;  
  
      log.debug({details: "there are "+searchResultSet.columns.length+" duplicate vendors"});
  
      currentRecord.setText({
          fieldId: 'custrecordvc_merge_vendor_total_unique_v',
          text: noOfDupVendors
      });
  
      }catch(e){
          log.error("error at getinputdata stage","error detail is :"+e.message);
      }
  </code></pre>