Find Sales Orders With the Same Customer PO Number in NetSuite

Build a summary saved search that groups NetSuite sales orders by PO/Check Number and keeps only PO numbers used more than once, then drill into the duplicate and open both orders.

The quick answer

Create a Transaction saved search. On Criteria > Standard, add Main Line is true, Type is Sales Order and PO/Check Number is not empty. On Criteria > Summary, add Summary Type Count, Field Document Number, greater than 1. On Results, click Remove all, then add PO/Check Number with Summary Type Group and Document Number with Summary Type Count. Save & Run. Every row left is a PO number that sits on two or more sales orders you can see, whichever customers they belong to. Click the PO number to see the orders behind it.

The example company is Northgate Fastener Supply, with seven sales orders waiting to ship. One customer PO number, TI-2209, was keyed on two of them, under two different customers. All people, companies, orders and amounts in the screenshots are fictional example data.

Before you start

PO # on the sales order form is the field saved searches call PO/Check Number. You need permission to create saved searches and to see sales orders. The example uses the Administrator role. A restricted role, or a role limited to certain subsidiaries, only counts the orders it can see, so it can miss the other half of a pair.

Decide which orders you care about. This search has no status filter, so it checks every sales order with a PO number, open or closed. If you only want to catch duplicates before they ship, you can add a Status criterion later. Be careful with that: filtering out closed orders can hide the older half of a pair.

The search groups on the exact value in the field. If one order says TI-2209 and another says TI 2209 or has a trailing space, expect two separate groups, and neither shows up as a duplicate.

01 · Check the Sales Orders list

Go to Transactions > Sales > Enter Sales Orders > List. The list shows the PO/Check Number column. In the example there are seven orders, SO2301 to SO2307, five with a PO number and two without. TI-2209 is on SO2302 for Tamarack Industrial and again four rows down on SO2306 for Cobalt Bay Marine.

TI-2209 shows up on SO2302 and again on SO2306, four rows apart.

With seven orders you can spot it by reading. With a few hundred, the two rows are rarely near each other, and that's where a saved search earns its keep.

Go to Reports > Saved Searches > All Saved Searches > New, then click Transaction in the list of search types. Lists > Search > Saved Searches > New gets you to the same page.

Reports > Saved Searches > All Saved Searches > New opens the list of search types.

In Search Title, type Duplicate Customer PO Numbers. In ID, type _dup_customer_po. NetSuite adds the customsearch prefix when you save, so the script ID becomes customsearch_dup_customer_po. The ID has to be unique in the account. If you leave it blank, NetSuite generates one.

Name the search and give it an ID.

03 · Pick one row per sales order with a PO

On the Criteria tab, stay on the Standard subtab. Choose Main Line in the Filter column. In the popup, select Yes and click Set. The row reads Main Line is true.

Main Line set to Yes keeps one row per order.

Main Line matters more than it looks. Without it, a Transaction search also returns the order's item lines and other line-level rows, so a three-line order counts as several rows under its PO number and looks like a duplicate by itself.

Next, choose Type, select Sales Order and click Set. PO/Check Number also holds check numbers on payments, so this keeps them out. Then choose PO/Check Number, set the operator to not empty and click Set. Without that last one, every order with no PO falls into one blank group, shown as - None -, and shows up as a duplicate.

Three standard criteria: Main Line is true, Type is Sales Order, PO/Check Number is not empty.

04 · Keep only PO numbers used more than once

Click the Summary subtab under Criteria. Set Summary Type to Count and Field to Document Number. In the popup, choose greater than, enter 1 and click Set.

Count of Document Number, greater than 1.

Click Add to commit the row. It reads Count, Document Number, is greater than 1. Set fills in the row; Add is what puts it in the list.

The summary criterion filters grouped rows, not individual orders.

Summary criteria work on the grouped results. The standard criteria decide which orders get counted, and the summary criterion keeps only the groups whose count is more than 1. That's why the search returns duplicates and nothing else.

05 · Group the results by PO number

Open the Results tab and click Remove all, so no default column turns into an extra group. Add PO/Check Number with Summary Type Group, then Document Number with Summary Type Count. You get one row per PO number with the number of orders that carry it.

Group by PO/Check Number and count Document Number.

Don't group by the customer as well. It's tempting to add Name with Summary Type Group so the customer shows up. But then TI-2209 splits into one row for Tamarack Industrial and one for Cobalt Bay Marine, each with a count of 1, and the summary criterion hides both. A PO keyed on the wrong customer is exactly the mistake you're trying to catch.

A second Group column on Name would split a PO used by two customers into two rows of 1.

If you added it, select the Name row and click Remove. You'll see the customer when you drill down and open the orders.

Click Save & Run. Duplicate Customer PO Numbers: Results shows Total: 1 and one row: PO/Check Number TI-2209 with Count of Document Number 2, then a Total row of 2. The three PO numbers used only once and the two orders with no PO aren't listed.

One PO number is on more than one order: TI-2209, on 2.

The saved search keeps working. Run it again next week and it shows whatever PO numbers have been reused since.

07 · Drill into the duplicated PO number

Click TI-2209. Duplicate Customer PO Numbers: TI-2209 Results shows Total: 2 and lists SO2302 and SO2306, each with PO/Check Number TI-2209 and an Edit | View link. Return To Summary takes you back to the grouped page.

The drill-down lists the two orders behind the count.

08 · Confirm the duplicate on the orders

Click View on SO2302. The sales order shows Customer Tamarack Industrial and PO # TI-2209.

SO2302: Tamarack Industrial, PO # TI-2209.

Click Back, then View on SO2306. It shows Customer Cobalt Bay Marine and the same PO #, TI-2209.

SO2306: Cobalt Bay Marine carries the same PO # TI-2209.

Check the result

  1. Summary: Duplicate Customer PO Numbers returns one row, TI-2209 with Count of Document Number 2.
  2. Drill-down: TI-2209 lists SO2302 and SO2306 and nothing else.
  3. Orders: SO2302 is for Tamarack Industrial and SO2306 is for Cobalt Bay Marine, both with PO # TI-2209.

Two customers carry one PO number, so one of these orders needs fixing before it ships. Which one is a call for whoever has the customer's actual PO.

For more on summary pages, see how to drill down from a summary saved search total and how to sum invoice amounts by customer in a saved search.

Common questions

What's the difference between standard and summary criteria in a saved search?

Standard criteria filter individual transactions before anything is grouped. Summary criteria filter the grouped rows afterward. Here, the standard criteria pick sales orders with a PO number, and Count of Document Number greater than 1 keeps only the PO numbers that more than one of those orders share.

Why does my duplicate search show a "- None -" group?

That's the group for orders with a blank PO/Check Number. All the blanks land in one group, so it looks like one PO used many times. Add PO/Check Number is not empty to the standard criteria and it goes away.

Why does the search need Main Line is true?

Without it, a Transaction search returns line-level rows as well as the order header, so one order with three items counts three times under its PO number. Main Line is true gives one row per sales order, which is what you want to count.

Why does my duplicate PO search miss orders entered under different customers?

You're probably grouping by the customer as well as the PO number. With Name as a second Group column, a PO keyed on two different customers becomes two groups with a count of 1, and the summary criterion hides both. Group by PO/Check Number alone.

How do I check only open sales orders?

Add a Status criterion to the standard criteria with the statuses your process still acts on, such as Pending Fulfillment. Leave the summary criterion alone. Keep in mind that a pair where one order is already closed won't show up anymore.

Can NetSuite stop someone from entering a duplicate PO number?

Not with this search. A saved search finds duplicates after they're saved. Blocking or warning at entry takes a workflow or a script that checks the PO number before the order saves.

Can I get an email when a duplicate shows up?

Yes. Schedule the saved search on its Email subtab so the results go to you or your team on a regular basis. Test it with a known duplicate before you rely on it.

Does this work for purchase orders or other transactions?

The same pattern works. Change the Type criterion to the transaction you care about and group on the field that holds the outside reference number for that record. Keep Main Line is true and the Count greater than 1 summary criterion.