我能够使 api 在 php 中工作并通过内部 id 搜索客户。但是我有一个场景,我将通过自定义字段搜索客户。在客户下,它有一个自定义选项卡,其中包含多个域名和域详细信息。
例如 :
主要搜索条件:域名
在netsuite php api中这怎么可能?非常感谢任何帮助。我只是 NetSuite 的新手。我将如何修改此示例代码以按自定义字段搜索?
$service = new NetSuiteService();
$request = new GetRequest();
$request->baseRef = new RecordRef();
$request->baseRef->internalId = "1780";
$request->baseRef->type = "customer";
$getResponse = $service->get($request);
if (!$getResponse->readResponse->status->isSuccess) {
echo "GET ERROR";
} else {
$customer = $getResponse->readResponse->record;
//var_dump($customer);
echo "GET SUCCESS, customer:";
echo "\nCompany name: ". $customer->companyName;
echo "\nInternal Id: ". $customer->internalId;
echo "\nEmail: ". $customer->email;
echo "\nCustomerID: ". $customer->firstName;
}
好的,我正在尝试从 egrubaugh360 获取所有域库的自定义记录。
$service = new NetSuiteService();
$request = new GetRequest();
$request->baseRef = new CustomRecordRef();
$request->baseRef->internalId = "47";
//$request->baseRef->externalId = "xxxx";
$request->baseRef->typeId = "custom_list_domains";
$getResponse = $service->get($request);
var_dump($getResponse);
if (!$getResponse->readResponse->status->isSuccess) {
echo "GET ERROR";
} else {
var_dump($getResponse->readResponse->record);
echo "GET SUCCESS";
}
我不确定要在“typeId”中输入什么,到底要输入什么类型?它给了我错误“无效的自定义记录类型键”
object(GetResponse)#8 (1) { ["readResponse"]=> object(ReadResponse)#9 (2) { ["status"]=> object(Status)#10 (2) { ["statusDetail"]=> array(1) { [0]=> object(StatusDetail)#11 (3) { ["code"]=> string(26) "INVALID_CSTM_RCRD_TYPE_KEY" ["message"]=> string(31) "Invalid custom record type key." ["type"]=> string(5) "ERROR" } } ["isSuccess"]=> bool(false) } ["record"]=> NULL } }