Elena kretova

Netsuite Transaction search performance

Discussion created by Elena kretova on Mar 10, 2018

I am utilizing Netsuite API (variant v2016_2) to seek information. With underneath code, it appears that Netsuite requiring much investment to give reaction for the question. I am looking GL exchange of periticular period that has 149 MainLine record and 3941 LineItem (Journal Entries) record and Netsuite takes very nearly 22 minutes to give this information accordingly. The following is code scrap that I am utilizing to look exchange.

public void GetTransactionData() {         DataTable dtData = new DataTable();         string errorMsg = "";         LoginToService(ref errorMsg);          TransactionSearch objTransSearch = new TransactionSearch();         TransactionSearchBasic objTransSearchBasic = new TransactionSearchBasic();         SearchEnumMultiSelectField semsf = new SearchEnumMultiSelectField();          semsf.@operator = SearchEnumMultiSelectFieldOperator.anyOf;         semsf.operatorSpecified = true;         semsf.searchValue = new string[] { "Journal" };         objTransSearchBasic.type = semsf;           objTransSearchBasic.postingPeriod = new RecordRef() { internalId = "43" };          objTransSearch.basic = objTransSearchBasic;           //Set Search Preferences         SearchPreferences _searchPreferences = new SearchPreferences();         Preferences _prefs = new Preferences();         _serviceInstance.preferences = _prefs;         _serviceInstance.searchPreferences = _searchPreferences;         _searchPreferences.pageSize = 1000;         _searchPreferences.pageSizeSpecified = true;         _searchPreferences.bodyFieldsOnly = false;          //Set Search Preferences          try         {             SearchResult result = _serviceInstance.search(objTransSearch);     /*     Above line taking almost 22 minutes for below record count      result.recordList.Length = 149     Total JournalEntryLine = 3941     */               List<JournalEntry> lstJEntry = new List<JournalEntry>();             List<JournalEntryLine> lstLineItems = new List<JournalEntryLine>();              if (result.status.isSuccess)             {                 for (int i = 0; i <= result.recordList.Length - 1; i += 1)                 {                      JournalEntry JEntry = (JournalEntry)result.recordList[i];                     lstJEntry.Add((JournalEntry)result.recordList[i]);                      if (JEntry.lineList != null)                     {                          foreach (JournalEntryLine line in JEntry.lineList.line)                         {                             lstLineItems.Add(line);                         }                     }                 }             }               try             {                 _serviceInstance.logout();             }             catch (Exception ex)             {              }         }          catch (Exception ex)         {             throw ex;         }     }

I can't realize that If I am missing something in my code or this is something about the information. If it's not too much trouble recommend me some kind of answer for this.

Outcomes