Ever run a Transaction saved search and get way more rows than you expected? You’re probably looking at line-level data without asking for it. When I was first learning NetSuite this was an issue I ran into a few times before learning the importance of this criteria.
On Sales Orders, Invoices, Bills, and friends, NetSuite stores a header and a row per line item. Leave Main Line unset and you get both; so a 10-line order can show up as 11 rows (or more, once you add tax/shipping lines).
The fix: add this criteria to almost every header-focused Transaction search:
- Filter: Main Line
- Operator: is
- Value: True (or
Tin a formula / SuiteScript filter)
In SuiteScript that looks like:
filters: [
['mainline', 'is', 'T'],
// ...other filters
]
When to leave it off: you actually need item, quantity, amount, or other line fields. Then keep Main Line = F (or omit it) and be intentional about grouping/summarizing.
Rule of thumb: if you care about the document (status, date, entity, total), turn Main Line on. If you care about the lines, leave it off — and expect more rows.
Comments
Post a Comment