soap - Netsuite API - PHP Attach custom fields to new customers -
i having trouble netsuite api. trying add customer custom field type. netsuite documentation of no help. appreciate get. thank you.
$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 , 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>"; }
i have posted in-depth code example on blog demonstrates how add customer netsuite custom fields in php. should @ least start on right path.
Comments
Post a Comment