gpt4 book ai didi

php - Netsuite API - PHP 将自定义字段附加到新客户

转载 作者:行者123 更新时间:2023-12-04 05:44:12 25 4
gpt4 key购买 nike

我在使用 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 .它至少应该让你走上正确的道路。

关于php - Netsuite API - PHP 将自定义字段附加到新客户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10899816/

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