Skip to content
This repository has been archived by the owner on May 2, 2023. It is now read-only.

Commit

Permalink
Increased default batch size and corrected a bug where id filter woul…
Browse files Browse the repository at this point in the history
…d not increment in the RESTlet
  • Loading branch information
James Christie authored and James Christie committed May 7, 2012
1 parent 30c13c8 commit c58888c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion lib/netsuite-rest-client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ def get_saved_search(record_type, search_id, options={})
end

begin
puts params['batch_size']
results_segment, params['start_id'] = *parse_json_result_from_rest(:get, params)
results_segment.class == Array ? results += results_segment : raise("Search error: #{results_segment}")
puts "Fetched #{results.count} records so far, querying from #{params['start_id']}..." if options[:verbose]
Expand Down
1 change: 1 addition & 0 deletions lib/restlets/rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ function getSavedSearch(request) {
var tempItems = nlapiSearchRecord(recordType, searchId, searchFilters, returnColumns);
if(tempItems) {
lowerBound = tempItems[tempItems.length - 1].getId();
searchFilters = [new nlobjSearchFilter('internalidnumber', null, 'greaterthan', lowerBound)];
accumulatedResults = accumulatedResults.concat(tempItems);
}
} while(tempItems && tempItems.length == 1000 && accumulatedResults.length < batchSize);
Expand Down

0 comments on commit c58888c

Please sign in to comment.