I use some web services provided by Netsuite
https://system.netsuite.com/help/helpcenter/en_US/Output/Help/SuiteFlex/WebServices/STP_searchMore.html#1087957
This allows me to get only 1000 rows at a time, and then I need to do a second search of the next set of 1000 rows and so on. There is some sample code, but it returns only the second set of lines, I'm not sure how to get the third, fourth, etc.
My code so far:
private void getAllCustomers()
{
CustomerSearch custSearch = new CustomerSearch();
CustomerSearchBasic custSearchBasic = new CustomerSearchBasic();
String statusKeysValue = "16,13,15";
SearchMultiSelectField status = null;
if (statusKeysValue != null && !statusKeysValue.Trim().Equals(""))
{
status = new SearchMultiSelectField();
status.@operator = SearchMultiSelectFieldOperator.anyOf;
status.operatorSpecified = true;
string[] nskeys = statusKeysValue.Split(new Char[] { ',' });
RecordRef[] recordRefs = new RecordRef[statusKeysValue.Length];
for (int i = 0; i < nskeys.Length; i++)
{
RecordRef recordRef = new RecordRef();
recordRef.internalId = nskeys[i];
recordRefs[i] = recordRef;
}
status.searchValue = recordRefs;
custSearchBasic.entityStatus = status;
}
custSearch.basic = custSearchBasic;
SearchResult response = _service.search(custSearch);
if (response.status.isSuccess)
{
processGetAllCustomersResponse(response);
SearchResult seachMoreResult = searchMore(response);
if (seachMoreResult != null)
{
if (seachMoreResult.status.isSuccess)
{
processGetAllCustomersResponse(seachMoreResult);
}
else
{
}
}
}
else
{
}
}
private SearchResult searchMore(SearchResult response)
{
while (response.totalRecords > (response.pageSize * response.pageIndex))
{
return _service.searchMore(response.pageIndex + 1);
}
return null;
}
In processGetAllCustomersResponse I just paste the rows into another database that works fine (except that I don't get all the rows I need).