Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Stay in the Know
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Howto: Set a custom field
I have no idea how this works for two custom fields, but here's how you set for an entity field:
[PHP]
$customFieldList = new nsComplexObject('CustomFieldList');
$StringCustomFieldRef = new nsComplexObject('StringCustomFieldRef');
$StringCustomFieldRef->setFields(array(
'internalId' => 'custentity_mb',
'value' => 'HELLO THERE'
));
$customFieldList->setFields(array(
'customField' => $StringCustomFieldRef
));
// create array of customer fields
$customerFields = array (
'isPerson' => true,
'firstName' => $firstName,
'lastName' => $lastName,
'companyName' => $companyName,
'phone' => $phone,
'email' => $email,
'customFieldList' => $customFieldList
//there's more code here (see sample_add_customer.php), but omitting..
);
// create Customer record
$customer = new nsComplexObject('Customer');
// set fields
$customer->setFields($customerFields);
[PHP]
$customFieldList = new nsComplexObject('CustomFieldList');
$StringCustomFieldRef = new nsComplexObject('StringCustomFieldRef');
$StringCustomFieldRef->setFields(array(
'internalId' => 'custentity_mb',
'value' => 'HELLO THERE'
));
$customFieldList->setFields(array(
'customField' => $StringCustomFieldRef
));
// create array of customer fields
$customerFields = array (
'isPerson' => true,
'firstName' => $firstName,
'lastName' => $lastName,
'companyName' => $companyName,
'phone' => $phone,
'email' => $email,
'customFieldList' => $customFieldList
//there's more code here (see sample_add_customer.php), but omitting..
);
// create Customer record
$customer = new nsComplexObject('Customer');
// set fields
$customer->setFields($customerFields);
0