NetSuite: How to Build a Saved Search That Returns Only First-Time Event Attendance (Workflow Input Needed)

I’m hoping someone can point me in the right direction with a workflow/saved search problem. I apologize for the long explanation, but I want to clearly outline the challenge, and I’d be very grateful for any suggestions.

Goal

I have a daily workflow to check a checkbox on a Seminar Attendance (SA) custom record that identifies when a customer attends an event for the first time for a given event-type. We will use this flag for analytics around customer entry points and “first touch” events.

The Challenge

We have several million SA records going back to the early 2000s. Customers may attend the same event-type many times.

Example: a customer attended Event A 8 times over 10+ years, and then attends it again recently. When their 9th SA record is created, the workflow must determine whether this is their first Event A or not.

I need a way for the saved search (triggering the workflow) to return only those SA records where the customer is attending that event-type for the first time.

What I’ve Tried

  • If I let the search look across all time, the dataset becomes enormous and slow.
  • If I filter by event date (e.g., only events from 2025), the search can’t look backward to detect whether the customer attended the same event-type before 2025.
  • I can get the earliest attendance using a MINIMUM(Event Date) summary result grouped by Customer + Event Type — but workflows can’t use summary-type results because they’re not stored on the record.

Sticking Point

I have not found a way to make a saved search return only the SA records that represent a customer’s first-ever attendance for that event-type, without relying on summary results.

Question

How can I build a saved search that only returns first-time attendance records (per event-type per customer) so a daily workflow can check a flag on those SA records?

Has anyone solved something similar at scale?

If you read this far, thank you.
Stephen

Rookie Asked on November 21, 2025 in Saved Searches.
Add Comment
3 Answer(s)

Stephen,

You can solve this with saved searches plus workflow, but there’s one key trick that avoids the “workflows can’t use summary results” limitation. The pattern is to use a summary saved search feeding a non-stored custom field, then let a workflow read that field and set the stored checkbox.

Here’s the approach that works at scale (I’ve used it for record types with millions of rows).


1. Create a summary saved search to identify the earliest SA record per Customer per Event Type

Search type: your Seminar Attendance custom record.

Results:

  • Customer – Group
  • Event Type – Group
  • Internal ID – Minimum

This gives you exactly one row per Customer + Event Type, with the earliest SA internal ID for that combo.

On the Available Filters tab add:

  • Customer
  • Event Type

This lets other fields filter the search by “this customer” and “this event type.”

Save this as something like SA – First Attendance Summary.


2. Create a non-stored custom field to expose that earliest SA ID on every SA record

Custom field on Seminar Attendance:

  • Type: Integer (or text is fine)
  • Store Value: unchecked (very important)

On Validation and Defaulting:

  • “Search”: select the summary search you created
  • Map the summary search filters to the current record:
    • Customer filter → SA.Customer field
    • Event Type filter → SA.Event Type field

Now when you view any SA record, this field will show the internal ID of the first-ever SA for that customer/event-type pair.

Every later attendance for the same customer/event type will display the same earliest ID in this field, which is what we need.


3. Add a stored checkbox field for “First Attendance for This Event Type”

Just a normal stored checkbox that your workflow will set.


4. Use a workflow to compare the two IDs

Create either:

  • a scheduled workflow that runs daily, or
  • an event-based workflow (After Submit) if you only care about new SA records going forward.

Workflow action:

Set Field Value on your checkbox field, using this formula:

CASE WHEN {custrecord_earliest_sa_id} = {internalid}
     THEN 'T'
     ELSE 'F'
END

If the SA you’re looking at is the earliest SA record for that customer/event type, it will check the box. If not, it stays unchecked. No summary values need to be processed by the workflow itself.


Why this approach works well with very large datasets

  • The summary search does the heavy lifting once, and NetSuite is very efficient at MIN() grouping over indexed fields.
  • The non-stored custom field simply “plugs in” the earliest ID for the current record.
  • The workflow only performs a simple comparison, which is fast even with millions of historical records.
  • Your final checkbox is stored, so it’s perfect for analytics, KPIs, dashboards, data exports, etc.

Optional: Backfilling historical data

If you want to flag all old records:

  • Temporarily schedule the workflow against all SA records (no date filter).
  • Let it run once overnight.
  • Then restrict it again to only new/updated records.
Rookie Answered on November 23, 2025.

MMFRANKLIN75, thank you.

Understood.
I’m excited to try this out,
and will get back to you soon with the results.

on November 23, 2025.
Add Comment

I’ve tried this out several ways and from @mmfranklin75 instructions, I run across the following block.

Section 1
Results:

  • Customer – Group
  • Event Type – Group
  • Internal ID – Minimum

The non-stored custom field, presents an error in each SA record:
“ERROR: Field value cannot be derived from search with Group summary type.”

RE: NetSuite: How to Build a Saved Search That Returns Only First-Time Event Attendance (Workflow Input Needed)

In the saved search,
when I remove the two ‘grouped’ results, and leave the ‘minimum’ result,
I do get an ID showing in customer’s SA records, but it is the same ID in all SA records.

The second thing I don’t get is,
when editing the custom field, Validation & Defaulting, Search,
how can I “Map the summary search filters to the current record.”

Section 2
Map the summary search filters to the current record:

  • Customer filter → SA.Customer field
  • Event Type filter → SA.Event Type field

I can select the saved search, and then one compare-to …

RE: NetSuite: How to Build a Saved Search That Returns Only First-Time Event Attendance (Workflow Input Needed)

Cheers.

Rookie Answered on November 27, 2025.
Add Comment

Working this through, removing all summary ‘Group’ from the saved search and retaining ‘Minimum’ only.
The search now returns one rolled up result, an ID.

The custom field is now working with that, and an ID is showing up in the SA records.
So far so good.

When I investigate individual customer’s SA records for different event-types they attended – the new custom field – it displays the earliest ID (singular event) from all that customer’s attended event-types.
To clarify: only the ID of one event; their earliest event.

So, I’m not getting that differentiation of event-types i.e. the ID of the earliest of each event-type, attended by the customer.

Referring back to mmfranklin75’s instructions,
“Now when you view any SA record, this field will show the internal ID of the first-ever SA for that customer/event-type pair.”

I’m looking for a way to filter for the pair, “… for that customer/event-type pair.”

Thank you in advance for any questions or feedback,
Stephen

Rookie Answered on November 29, 2025.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   SuiteMigration   Become a Sponsor