gpt4 book ai didi

php - NetSuite 添加客户地址

转载 作者:可可西里 更新时间:2023-11-01 00:58:06 24 4
gpt4 key购买 nike

我在 StackOverflow 上看到了其他示例,但都不适合我,我的代码在 NetSuite 中创建了一个地址行,但地址 1、城市、州和 zip 为空,默认账单和运费显示为 false 或者如果我将其设置为 true 它显示 true 以便该部分正在更新.. 响应不显示任何错误。有什么想法吗?

这是我的代码:

$customer = new Customer();
$customer->internalId = 16;
$customer->firstName = 'Joe';
$customer->middleName = 'A';
$customer->lastName = 'Smith';
$customer->email = 'joe@email.com';

$address = new CustomerAddressBook();
$address->defaultShipping = false;
$address->defaultBilling = false;
$address->isResidential = true;
$address->addr1 = '123 Street';
$address->city = 'New York';
$address->zip = '12345';
$address->state = 'NY';

$addressBook = new CustomerAddressbookList();
$addressBook->addressbook = array($address);
$addressBook->replaceAll = false;

// add address to cutomer
$customer->addressbookList = $addressBook;


$request = new UpdateRequest();
$request->record = $customer;

$netsuiteService = new NetSuiteService();
$response = $netsuiteService->update($request);

最佳答案

$address = new Address();
$address->addr1 = '123 Street';
$address->city = 'New York';
$address->zip = '12345';
$address->state = 'NY';

$address_book = new CustomerAddressBook();
$address_book->defaultShipping = false;
$address_book->defaultBilling = false;
$address_book->isResidential = true;
$address_book->addressbookAddress = $address;

$address_book_list = new CustomerAddressbookList();
$address_book_list->addressbook = $address_book;
$address_book_list->replaceAll = false;

$customer = new Customer();
$customer->internalId = 16;
$customer->firstName = 'Joe';
$customer->middleName = 'A';
$customer->lastName = 'Smith';
$customer->email = 'joe@email.com';
$customer->addressbookList = $address_book_list;


$request = new UpdateRequest();
$request->record = $customer;

$netsuiteService = new NetSuiteService();
$response = $netsuiteService->update($request);

if (!$response->writeResponse->status->isSuccess) {
echo "UPDATE ERROR";
} else {
echo "UPDATE SUCCESS, id " . $response->writeResponse->baseRef->internalId;
}

关于php - NetSuite 添加客户地址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35461142/

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