G.J G.J - 1 year ago 117
PHP Question

NetSuite - PHP search to get more than 1000 records

I'm working with NetSuite PHP Toolkit(2013_2 version). And I was able to make successful Saved-Search and Customer-Search. Except that, my actual customers are 1800 in total, whereas I get only 1000 records from my NetSuite call. So I need to know, if we can fetch all the records(more than 1000) in a NetSuite call using PHP toolkit. My code goes like this basically...

$service = new NetSuiteService();
$search = new CustomerSearchAdvanced();
$search->savedSearchId = "115"; //internal ID of saved search

$request = new SearchRequest();
$request->searchRecord = $search;

$searchResponse = $service->search($request);

Thanks in advance!!

Answer Source

1000 Records is a hard limit. You have to use searchMoreWithId (Docs).

Code should look like this

$searchId = $searchResponse['searchId'];
$request = new SearchMoreWithIdRequest();
$request->searchId = $searchId;
$request->pageIndex = 2;
$moreSearchResponse = $service->searchMoreWithId($request); 
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download