NetSuite Saved Search: Compare Header vs Line Location
Sales orders with cross-subsidiary fulfillment often carry a header-level location that differs from the line-level inventory location.
Suite UtilsHow we write these guides
On this page
Sales orders with cross-subsidiary fulfillment often carry a header-level location that differs from the line-level inventory location. That mismatch creates fulfillment errors, incorrect cost allocation, and intercompany elimination problems. A single saved search can flag these discrepancies in real time without exporting to Excel.
Why the Standard Approach Falls Short
When you filter a transaction search to Main Line = True, NetSuite returns only the header row. When you filter to Main Line = False, you get only line items. The two rows never appear together, so a simple formula column cannot reference both values simultaneously. The workaround, two searches, a VLOOKUP, and an IF formula, works once but breaks down for dashboard reminders that need to refresh automatically.
The Formula Column Technique
Create one transaction saved search (Type: Sales Order) with Main Line = False on the Criteria tab. This returns every line item row. Then use a formula column to pull the header location onto each line row for comparison.
Step-by-Step Build
- Navigate to Reports > Saved Searches > All Saved Searches > New > Transaction Saved Search.
- Criteria tab:
- Type = Sales Order
- Main Line = False
- Status = Sales Order:B (Pending Fulfillment), adjust as needed
- Add any subsidiary or date filters your dashboard requires
- Results tab, add these columns in order:
| Column | Label | Formula (Formula (Text)) | Summary Type |
|---|---|---|---|
| 1 | Document Number | {tranid} | Group |
| 2 | Line | {line} | Group |
| 3 | Item | {item} | Group |
| 4 | Header Location | {location} | Group |
| 5 | Line Location | {inventorylocation} | Group |
| 6 | Location Mismatch | CASE WHEN {location} <> {inventorylocation} THEN 'MISMATCH' ELSE 'OK' END | Group |
- Highlighting (optional): Edit the Location Mismatch column > Conditional Formatting > When "MISMATCH" > Background Red, Font White.
The header location (
{location}) is available on every line row because NetSuite carries the main-line value down to each sub-line in the search result set. The line-level inventory location ({inventorylocation}) is native to the item sublist.
Field ID Reference
| UI Label | Field ID | Record Level |
|---|---|---|
| Location (header) | location | Transaction header |
| Inventory Location (line) | Transaction line (item sublist) | |
| Main Line | mainline | Transaction (boolean) |
Interpreting Results
- OK, Header and line locations match. Fulfillment will source from the expected location.
- MISMATCH, The sales order header shows one location (e.g., "NY Warehouse") while the line item points to another (e.g., "CA Warehouse"). This order will either fail cross-subsidiary fulfillment routing or post inventory to the wrong subsidiary.
Add the search to a Dashboard Reminder with Available for Reminders enabled on the search. The reminder count shows only "MISMATCH" rows when you filter the reminder portlet to Location Mismatch = MISMATCH.
Common Variants
Include Subsidiary Context
Add {subsidiary} and {inventorylocation.subsidiary} as columns to see cross-subsidiary fulfillment at a glance. A mismatch where the header subsidiary differs from the line inventory location subsidiary is the highest-risk scenario.
Filter to Open Orders Only
On the Criteria tab, add:
- Status = Sales Order:A (Pending Approval), Sales Order:B (Pending Fulfillment)
- Or use Formula (Numeric) =
CASE WHEN {status} IN ('SalesOrd:A','SalesOrd:B') THEN 1 ELSE 0 END= 1
Capture the Fulfillment Location Too
If you use Advanced Shipping or WMS, the actual fulfillment location may differ from both. Add the fulfillment location field to a separate item fulfillment search and join via {tranid}.
Limitations to Know
- Journal Entries: The Main Line filter does not work on Journal Entry searches (per Oracle documentation). This technique applies to Sales Orders, Purchase Orders, Transfer Orders, and Invoices.
- OneWorld Intercompany: If the header location belongs to Subsidiary A and the line inventory location belongs to Subsidiary B, the mismatch triggers an intercompany elimination entry at month-end. Flag these before period close.
- Performance: On datasets over 50,000 open sales orders, add a date filter (e.g., Created Within Last 30 Days) to keep the reminder portlet responsive.
When to Escalate Beyond the Search
If mismatches persist after correcting the sales order, check:
- Default Inventory Location on the item record. On the item record, click the Purchasing/Inventory subtab.
- Location Assignment on the customer record (Financial tab > Default Location)
- Supply Chain Rules that may override line locations during allocation
The saved search catches the symptom. The root cause lives in master data or allocation rules, fix there, and the reminder count drops to zero.


