Below is a sample PHP script on how to perform a custom date search operation using "within" on the employee record using new PHP Toolkit 2012.2
require_once '../PHPToolkit/NetSuiteService.php';
$service = new NetSuiteService();
$service->setSearchPreferences(false, 20);
$emailSearchField = new SearchDateField();
$emailSearchField->operator = "within";
$emailSearchField->searchValue = "2011-11-01T03:00:02.000Z";
$emailSearchField->searchValue2 = "2012-12-19T19:00:01.426Z";
$search = new EmployeeSearchBasic();
$search->dateCreated = $emailSearchField;
$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