首页 > 解决方案 > How do I get the serialized inventory item by the inventory id in NetSuite api with PHP?

问题描述

Here is the situation, I'm trying to get the Serialized Inventory Item based on the id (https://xxx.app.netsuite.com/app/common/item/item.nl?id=522216), however, when I tried the following code:

       $search = new TransactionSearchBasic();
      
       $type = new SearchEnumMultiSelectField();
       $type->operator = 'anyOf';
       $type->searchValue = array('serializedInventoryItem');
       $search->type = $type;   

       $invetoryRef = new RecordRef();
       $invetoryRef->internalId = '522216';

       $params = new SearchMultiSelectField();
       $params->operator = 'anyOf';
       $params->searchValue = array($invetoryRef);
       $search->serializedInventoryItem = $params;

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

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

However, the response that I'm getting the following error:

The field type's enum value is invalid for this search.

Why would I be getting that error message?

Thank you,

Kevin Davis

标签: phpapinetsuite

解决方案


推荐阅读