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.
Narrative Insights is Temporarily Unavailable due to an Infrastructure Issue. Learn how This Impacts Your Account and What to Expect While the Feature is Disabled.
How to get custom fields from a Customer record
I have a rather simple PHP script which can perform a search and obtain a customer record. The search criteria is a custom field, which works OK.
There are other custom fields on the Customer record. They are visible when I var_dump() the results, so I know NetSuite is returning the data. But when I try to get the fields in the PHP script, no results are returned.
Example:
[PHP]// The following 3 lines work OK and set values.
$this->customer = $this->customerSearchRes->recordList[0];
$this->customerInternalID = $this->customer->getField('internalId');
$this->customerActive = !($this->customer->getField('isInactive'));
There are other custom fields on the Customer record. They are visible when I var_dump() the results, so I know NetSuite is returning the data. But when I try to get the fields in the PHP script, no results are returned.
Example:
[PHP]// The following 3 lines work OK and set values.
$this->customer = $this->customerSearchRes->recordList[0];
$this->customerInternalID = $this->customer->getField('internalId');
$this->customerActive = !($this->customer->getField('isInactive'));
0