Netsuite - 如何发送子列表值?
Netsuite - how to send a sublist value?
我很难在 Netsuite 上发送子列表值,有人可以给我提示吗?
我的代码如下所示:
$customer->address = "City B";
$customer->phone = "111-111";
$customer->officePhone = "333-333";
我不确定应该如何发送子列表值,应该是这样吗?
$customer->address->array('city' = "address field");
我试图搜索这个简单的问题,但找不到任何答案。
这是在 Netsuite 中更新客户地址的代码的 PHP 版本。
/**
* Updates Customer AddressBook in Netsuite
*
* @param int $iInternalId
* @param array $aAddress
* @return boolean
*/
function setAddressbook( $iInternalId, array $aAddress ){
$service = new NetSuiteService();
$address = new CustomerAddressBook();
$address->defaultShipping = false;
$address->defaultBilling = false;
$address->attention = $aAddress['attention'];
$address->addressee = $aAddress['addressee'];
$address->addr1 = $aAddress['addr1'];
$address->addr2 = $aAddress['addr2'];
$address->addr3 = $aAddress['addr3'];
$address->city = $aAddress['city'];
$address->state = $aAddress['state'];
$address->zip = $aAddress['zip'];
$addressBook = new CustomerAddressbookList();
$addressBook->addressbook = array($address);
// In case you want to Update and NOT Replace
$addressBook->replaceAll = false;
$customer = new Customer();
$customer->addressbookList = $addressBook;
$customer->internalId = $iInternalId;
$request = new UpdateRequest();
$request->record = $customer;
$updateResponse = $service->update($request);
if (!$updateResponse->writeResponse->status->isSuccess) {
return( false );
}
return( true );
}
我很难在 Netsuite 上发送子列表值,有人可以给我提示吗?
我的代码如下所示:
$customer->address = "City B";
$customer->phone = "111-111";
$customer->officePhone = "333-333";
我不确定应该如何发送子列表值,应该是这样吗?
$customer->address->array('city' = "address field");
我试图搜索这个简单的问题,但找不到任何答案。
这是在 Netsuite 中更新客户地址的代码的 PHP 版本。
/**
* Updates Customer AddressBook in Netsuite
*
* @param int $iInternalId
* @param array $aAddress
* @return boolean
*/
function setAddressbook( $iInternalId, array $aAddress ){
$service = new NetSuiteService();
$address = new CustomerAddressBook();
$address->defaultShipping = false;
$address->defaultBilling = false;
$address->attention = $aAddress['attention'];
$address->addressee = $aAddress['addressee'];
$address->addr1 = $aAddress['addr1'];
$address->addr2 = $aAddress['addr2'];
$address->addr3 = $aAddress['addr3'];
$address->city = $aAddress['city'];
$address->state = $aAddress['state'];
$address->zip = $aAddress['zip'];
$addressBook = new CustomerAddressbookList();
$addressBook->addressbook = array($address);
// In case you want to Update and NOT Replace
$addressBook->replaceAll = false;
$customer = new Customer();
$customer->addressbookList = $addressBook;
$customer->internalId = $iInternalId;
$request = new UpdateRequest();
$request->record = $customer;
$updateResponse = $service->update($request);
if (!$updateResponse->writeResponse->status->isSuccess) {
return( false );
}
return( true );
}