我想知道我是否可以通过API删除InventoryItem以及正确的类型ID,当然还有代码是正确的。
这是我的php代码
$deleteItem = new CustomRecordRef();
$deleteItem->typeId = "inventoryitem";
$deleteItem->internalId = 3237;
//$deleteItem->name = "ssllrgrwb1";
$delete = new DeleteRequest();
$delete->baseRef = $deleteItem;
$service = new NetSuiteService();
$delResponse = $service->delete($delete);
这是回复
DeleteResponse Object
(
[writeResponse] => WriteResponse Object
(
[status] => Status Object
(
[statusDetail] => Array
(
[0] => StatusDetail Object
(
[code] => INVALID_RCRD_TYPE
[message] => Invalid Record Type
[type] => ERROR
)
)
[isSuccess] =>
)
[baseRef] => CustomRecordRef Object
(
[internalId] => 3237
[externalId] =>
[typeId] => inventoryitem
[name] =>
)
)
)
由于
答案 0 :(得分:1)
应该是
$deleteItem = new RecordRef();