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.
Keep an eye out for upcoming NetSuite events, including meetups, workshops, and webinars. These sessions are a great way to connect with peers, learn from experts, and stay current on the latest NetSuite updates and best practices. Registration links are provided in each event.
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