我正在尝试使用 Netsuite 的 PHPtoolkip_v2010.php 添加新的客户记录并定义他们的默认送货和账单地址。但是我在阅读文档时遇到了麻烦。
这是我现在创建客户的方式:
$customer_data = array(
'firstName'=>$billing_address['first_name'],
'lastName'=>$billing_address['last_name'],
'email'=>$email,
'phone'=>$phone,
'isPerson'=>true
);
if(!empty($billing_address['company'])) $customer_data['companyName'] = $billing_address['company'];
$customer = new nsComplexObject('Customer', $customer_data);
$new_customer = $ns->add($customer);
if($new_customer->isSuccess) {
$customer_id = $new_customer->recordRef->nsComplexObject_fields['internalId'];
}
这成功地创建了客户记录并返回客户的 internalId。
模式浏览器列出了一个addressbookList
类型为 的字段listRel:CustomerAddressbookList
。我假设我需要创建一个列表,将地址添加到列表中,然后将列表附加到客户记录中。但我不确定如何去做。