<?php
require_once '../PHPToolkit/NetSuiteService.php';
$service = new NetSuiteService();
$service->setSearchPreferences(false, 20);
$phoneNumber = '869';
$phoneSearchField = new SearchStringField();
$phoneSearchField->operator = "startsWith";
$phoneSearchField->searchValue = $phoneNumber;
$search = new CustomerSearchBasic();
$search->phone = $phoneSearchField;
$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;
}
?>
No comments:
Post a Comment