<?php
$service = new NetSuiteService();
$service->setSearchPreferences(false, 20);
$custSearchField = new SearchStringField();
$custSearchField->operator = "contains";
$custSearchField->searchValue = "";
$custSearchField2 = new SearchBooleanField();
$custSearchField2->searchValue = false;
$search = new EmployeeSearchBasic();
$search->email = $custSearchField;
$search->isInactive = $custSearchField2;
$request = new SearchRequest();
$request->searchRecord = $search;
$searchResponse = $service->search($request);
if (!$searchResponse->searchResult->status->isSuccess) {
echo "SEARCH ERROR";
} else {
$records = $searchResponse->searchResult->recordList->record;
print "<select id=\"employeeselect\" name=\"employeeselect\" >";
foreach ($records as $record) {
print "<option value=\"" . $record->internalId . "\">" . $record->firstName . " " . $record->lastName; print "</option>";
}
print "</select>";
}
?>
No comments:
Post a Comment