How to group netsuite records as a row based on field other then internal id

When performing a NetSuite lookup, there is a Group Rows option, but it always seems to group based on the record’s internal ID. I recall there being an option to choose which field the grouping is based on—am I remembering that correctly?

My use case is sales order lines that I want to group by opportunity ID, not by the sales order internal ID.

Currently, because I can not group it on opportunity id, I tried this workaround which also did not work:

  1. The first lookup runs a saved search that groups results by opportunity ID.
  2. The second lookup fetches sales order lines using that opportunity ID.

However, the lines are still treated as separate records, and when grouping is applied, it again groups by the sales order internal ID rather than the opportunity ID.


etsu

You either need a preSend SuiteScript hook or to use a preSavePage script. Records for the same opportunity ID could bleed into multiple pages, so you'd either need a large page size or make two flows. The first flow would not have grouping; instead, you write back a file to the NetSuite File Cabinet. In the second flow, you use the group-by and sort functions when reading the file.