我有很多白发试图自己解决这个问题。
下面是从他们的电子邮件中获取联系人(与 Netsuite 中的客户不同,虽然两者都是本机数据类型)的代码。对于客户来说,这将非常相似。
$service = new NetSuiteService();
$service->setSearchPreferences(false, 20);
$recordRef = new RecordRef();
$recordRef->internalId = '-6'; //Internal ID for a customer is -2, contact is -6
$contactSearch = new ContactSearch(); //use CustomerSearch() for a customer
$contactSearchBasic = new ContactSearchBasic();//SearchRecordBasic
$contactSearchBasic->email = new SearchStringField();
$contactSearchBasic->email->searchValue = 'someone@somewhere.com';
$contactSearchBasic->email->operator = SearchStringFieldOperator::is;
$contactSearch->basic = $contactSearchBasic;
$searchRequest = new searchRequest(); //% contains a searchRecord
$searchRequest->searchRecord = $contactSearch;
$searchResponse = $service->search($searchRequest);