2

我在使用 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>";

}
4

0 回答 0