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.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
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