/// <summary> /// Retrieves a page from a Search originally executed using the <paramref name="session"/> token. /// </summary> /// <param name="pageIndex">Index of the result page to be retrieved.</param> /// <param name="prefs">Preference settings to be used for the search.</param> /// <param name="session">The search session.</param> /// <returns>Results on the specified page.</returns> public SearchResult SearchMore(int pageIndex, SearchPreferences prefs, SearchSession session) { try { SearchResult result = session.ServiceManager.SearchMoreWithId(session.SearchId, pageIndex, prefs); session.SearchId = result.searchId; session.PageIndex = result.pageIndex; return(result); } catch (Exception ex) { _log.Error(ex.ToString()); throw new NsException(ex); } }
/// <summary> /// Invokes NetSuite's search(..) method. /// </summary> /// <param name="searchRec">The search options.</param> /// <param name="session">The session to which the search and subsequent SearchMore(..), /// SearchNext(..) operations will belong.</param> /// <returns>Response from the WebService</returns> /// <remarks>Use this method only when SearchMore(..) or /// SearchNext(..) etc. calls are required.</remarks> public SearchResult Search(SearchRecord searchRec, SearchSession session) { try { SearchResult result = session.ServiceManager.Search(searchRec); session.PageIndex = result.pageIndex; session.SearchId = result.searchId; return(result); } catch (Exception ex) { _log.Error(ex.ToString()); throw new NsException(ex); } }