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
。リストを作成し、アドレスをリストに追加してから、リストを顧客レコードに添付する必要があると思います。しかし、どうすればいいのかわかりません。