Netsuite API - PHP将自定义字段附加到新客户
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Netsuite API - PHP将自定义字段附加到新客户相关的知识,希望对你有一定的参考价值。
我遇到了netsuite api的问题。我正在尝试添加具有自定义字段类型的客户。 netsuite文档没有任何帮助。我感谢任何帮助。谢谢。
$customFields = array('internalId' => 'custentity_nso_f_donortype',
'value' => new nsListOrRecordRef(array('internalId' => "1"))
);
$customObject = new nsComplexObject("SelectCustomFieldRef");
$customObject->setFields($customFields);
$customerFields = array (
'isPerson' => true,
'firstName' => $firstName,
'lastName' => $lastName,
'companyName' => $companyName,
'phone' => $phone,
'email' => $email,
'customFieldList' => $customObject,
'addressbookList' => array (
'addressbook' => array(
'addr1' => $addr1,
'city' => $city,
'state' => $state,
'zip' => $zip
)
)
);
// create Customer record
$customer = new nsComplexObject('Customer');
// set fields
$customer->setFields($customerFields);
// perform add operation and store nsWriteResponse object in $addResponse variable
$addResponse = $myNSclient->add($customer);
// handle add response
if (!$addResponse->isSuccess) {
echo "<font color='red'><b>" . $addResponse->statusDetail[0]->message . "</b></font>";
} else {
echo "<font color='green'><b>SUCCESS!!!</b></font>";
}
答案
我在我的博客上发布了一个相当深入的代码示例,演示了如何使用add a customer to Netsuite with custom fields in php。它应该至少让你走上正确的道路。
以上是关于Netsuite API - PHP将自定义字段附加到新客户的主要内容,如果未能解决你的问题,请参考以下文章