I'm trying to export Netsuite ItemFulfillment Records into a local database so I can import into UPS Worldship to send them. I'm able to export recently modified records, but can't figure out how to filter on the shipStatus. Can anyone help lead me in the correct direction?
What I have that exports recently modified records, but does not filter correctly on shipStatus:
require_once '/PHPToolkit/NetSuiteService.php';
$start_time = microtime(true);
$service = new NetSuiteService();
$transactionSearchBasic = new TransactionSearchBasic();
// type = itemFulfillment
$searchMultiSelectEnumField = new SearchEnumMultiSelectField();
$searchMultiSelectEnumField->operator = 'anyOf';
$searchMultiSelectEnumField->searchValue[] = '_itemFulfillment';
$transactionSearchBasic->type = $searchMultiSelectEnumField;
// lastmodified > datelastrun
$SearchDateField = new SearchDateField();
$SearchDateField->operator = "after";
$SearchDateField->searchValue = "2019-12-01T00:00:00";
$transactionSearchBasic->lastModifiedDate = $SearchDateField;
// shipStatus = picked
$SearchStringField = new SearchStringField();
$SearchStringField->operator = 'is';
$SearchStringField->searchValue = '_picked';
$transactionSearchBasic->shipStatus = $SearchStringField;
$transactionSearch = new TransactionSearch();
$transactionSearch->basic = $transactionSearchBasic;
$request = new SearchRequest();
$request->searchRecord = $transactionSearch;
$searchResponse = $service->search($request);
if (!$searchResponse->searchResult->status->isSuccess) {
echo "SEARCH ERROR";
} else {
echo "SEARCH SUCCESS, records found: " . $searchResponse->searchResult->totalRecords . PHP_EOL;
}
$end_time = microtime(true);
$execution_time = ($end_time - $start_time);
echo " Execution time of script = ".$execution_time." sec";
Not sure why _picked is not working.
Can you try using internal id of these status values.
Internal Id Text A Picked B Packed C Shipped
Instead of '_picked' try using 'A'.