gpt4 book ai didi

php - 在 PHP 中搜索 NetSuite 自定义记录类型

转载 作者:行者123 更新时间:2023-12-05 07:42:04 24 4
gpt4 key购买 nike

我有一个自定义记录类型,但我无法从项目值中搜索条形码:

enter image description here

我正在使用 NetSuite PHPToolkit_2015_2 和这个 stackoverflow 答案 https://stackoverflow.com/a/13366947/2120512http://burnignorance.com/netsuite-tips-and-hacks/working-with-custom-records-in-suitetalk/尝试构建此请求:

$service = new NetSuiteService();
// Perform an AdvancedSearch for Items
// https://netsuite.custhelp.com/app/answers/detail/a_id/12203/kw/php%20search%20criteria

$service->setSearchPreferences(false, 1000, false);
$savedSearchId = 'customsearch_barcode_view'; //customsearch## from UI ID field
$searchAdvanced = new CustomRecordSearchAdvanced();
setFields($searchAdvanced, array('savedSearchScriptId'=>$savedSearchId));

$request = new SearchRequest();
$request->searchRecord = $searchAdvanced;

// PHP Toolkit 2012.2: Sample Code to Perform Search that Uses a Custom Field as Filter
// https://netsuite.custhelp.com/app/answers/detail/a_id/25066/kw/php%20custom%20field

$custSearchField = new SearchMultiSelectCustomField();
$custSearchField->value = new ListOrRecordRef();
$custSearchField->value->internalId = "custrecord_barcode_item";
$custSearchField->value->value = "00001 Beer Mug";

$searchAdvanced->customFieldList = $custSearchField;

$results = $service->search($request);

我仍然得到自定义记录类型的所有结果,但始终无法弄清楚如何按项目进行搜索。我进行了更改,但仍收到完整的结果。

最佳答案

我很确定这不会立即解决您的问题,但乍一看我可以在您的代码中看到一个错误。

customFieldList是数组类型,所以需要改成:

$searchAdvanced->customFieldList = $custSearchField;

为此

$searchAdvanced->customFieldList = [$custSearchField];

关于php - 在 PHP 中搜索 NetSuite 自定义记录类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44866468/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com