In NetSuite, you may need to display the number of related records (e.g., number of transactions for a customer or number of child records). This can be achieved using a custom field with a saved search or summary logic.
This article explains common approaches to calculate and display record counts.
What is a Record Count Field?
A record count field displays the number of related records linked to a parent record.
Examples:
- Number of Sales Orders per Customer
- Number of Contacts per Customer
- Number of child records in a custom record
Approach 1: Using a Saved Search
This is the most common and flexible method.
Step 1: Create a Saved Search
- Go to: Reports > Saved Searches > All Saved Searches > New
- Select the appropriate record type (e.g., Transaction, Contact, Custom Record)
Step 2: Define Criteria
- Under Criteria subtab > Add filters to return only relevant records
Example:
- Type = Sales Order
- Main Line = True
Step 3: Set Results with Summary
- Go to the Results tab
- Add:
- Field: Internal ID (or any field)
- Summary Type: Count
- Add a Group field:
- Example: Customer (to group results per customer)
- If you will be using it for Dashboard View, Sublist View, or Reminders make sure to check this boxes:
Step 4: Save the Search
Give it a clear name (e.g., “Sales Order Count per Customer”).
Step 5: Display the Count
You can display the result using:
- A Custom Search portlet on the dashboard
- A Custom Sublist (via custom record or scripting)
- A Field sourcing approach (limited use case)
In this example we will use a Custom Search portlet
Upon clicking setup > Select your created Search and name your Custom Search Portlet on the Title field
Important Notes
- There is no native “count field” that dynamically updates without saved search or scripting
- Real-time counts require:
- Saved search (view-based) or
- Script (stored value)
Best Practices
- Use saved searches for reporting and dashboards
- Use scripts only when the count must be stored on the record
- Avoid heavy scripts on large datasets
- Test performance in Sandbox
Summary
To calculate record counts in NetSuite, the recommended approach is to use a saved search with summary type “Count.” For storing the value directly on a record, scripting may be required. Choosing the right method depends on whether you need a display-only count or a stored value.