gpt4 book ai didi

php - 使用 PHP 从 Netsuite 获取项目信息

转载 作者:可可西里 更新时间:2023-11-01 12:54:13 25 4
gpt4 key购买 nike

我正在尝试使用 PHP 工具包在 NetSuite 中按 ID 搜索产品。据我从 Google 搜索中可以看出,NetSuite 没有很好地记录他们的 PHP 工具包。据我所知,我有这个:

$service = new NetSuiteService();
$service->setSearchPreferences(false, 1000);

$search = new ItemSearchBasic();
$search->searchValue = array('internalId' => $id);
$search->type = "item";

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

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

但这只会给我一堆乱七八糟的废话。谁能帮我解决这个问题?

最佳答案

于是找了又哭,终于找到了解决办法。

function getProduct($id) {

$service = new NetSuiteService();
$service->setSearchPreferences(false, 1000);

$itemInfo = new SearchMultiSelectField();
$itemInfo->operator = "anyOf";
$itemInfo->searchValue = array('internalId' => $id);

$search = new ItemSearchBasic();
$search->internalId = $itemInfo;

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

$searchResponse = $service->search($request);
$products = $searchResponse->searchResult->recordList->record;

return $products;

}

关于php - 使用 PHP 从 Netsuite 获取项目信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25677049/

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