I am trying to get a list of items with their price + stock from a saved search I set up on Netsuite. This is my code:
$service = new NetSuiteService();
$service->setSearchPreferences(false, 1000, false);
$search = new ItemSearchAdvanced();
$search->savedSearchId = "1226"; // Your SavedSearch ID.
$request = new SearchRequest();
$request->searchRecord = $search;
$searchResponse = $service->search($request);
if (!$searchResponse->searchResult->status->isSuccess) {
echo "SEARCH ERROR";
} else {
echo "SEARCH SUCCESS, records found: " .
$searchResponse->searchResult->totalRecords . "\n";
var_dump($searchResponse);
}
However, although it has filtered results according to the criteria filter I set, It is returning every field for the items, rather than just the columns I have set in results -> columns on the saved search.
This seems to be making it very slow, It takes around 50 seconds to retrieve the 330 items.
Is there a way to make it only return select fields from the item, or just the columns I have set up in the saved search?
Thanks!