ANS-0414 · CUSTOM FIELDS, RECORDS & FORMS
Displaying Dynamic Custom Field Values in NetSuite Search Results
To ensure dynamic custom field values appear in NetSuite search results, they often need to be stored in a dedicated custom field.
Short answer
While `getCurrentAttribute` retrieves record attributes, displaying dynamic, non-stored custom search field values directly in NetSuite search results is often ineffective. To ensure visibility, store these values in a dedicated custom field using SuiteScript or workflows, then reference the stored field in your search.
Scenario
A user needs to display a custom search field value that is not stored directly on the record. When attempting to include such a dynamic field in search results, it appears blank. The challenge is to retrieve and present these calculated, non-stored values effectively within NetSuite.
Solution
While the getCurrentAttribute function is valid for retrieving record attributes in specific NetSuite contexts, such as SuiteCommerce or email templates, its direct application to display dynamic, non-stored custom search field values in standard search results is generally ineffective. As of NetSuite 2023.2, non-stored custom fields typically appear blank when included in search results.To effectively display dynamic custom field values in NetSuite search results, the recommended approach involves storing the calculated value in a dedicated, *stored* custom field. This can be achieved through:
SuiteScript
Develop a script to calculate the value and populate a stored custom field on the record.
Workflows
Configure a workflow to compute the value and update a stored custom field when specific record events occur.Once the dynamic value is stored in a custom field, it can then be reliably included and displayed in NetSuite search results. For contexts where
getCurrentAttributeis appropriate, such as displaying an item attribute in a SuiteCommerce template, the syntax remains:
<%getCurrentAttribute('item','custitem_fieldid')%>Expert NetSuite Support
Need help with this NetSuite issue?
Custom Fields, Records & Forms consulting and configuration support
