'Netsuite - Compare dates in saved search (system notes)

Example and background: Netsuite sets "Printed picking ticket" = "TRUE" when the picking ticket is printed on order X. The item fulfillment is only a partial delivery, "Printed picking ticket" is then turned back to "FALSE" on order X. Not great, since we would like to see printed quantity per orderline, but that's another issue. Picking ticket for order X is then printed again, but this time with 0 quantites commited, Netsuite sets "Printed picking ticket" = "TRUE" again, even though the picking ticket didn't contain any items.

When the back ordered items are being received, the "Printed picking ticket"-flag is not turned back to "FALSE" - meaning that it looks like it has been printed even though it's not. This is by design and a big flaw in my opinion.

One workaround could be to prevent users from printing empty picking tickets, but that's easier said than done.

I would like to create a saved search for all those orders, i.e. 1. printed empty picking ticket and 2. we receive goods.

For that, I need to go with the system notes. This is how I want the saved search to work:

Standard criteria: Type = Sales order Item type in (Assembly, Inventory Item) Main line, Shipping Line, Tax Line = False Printed picking ticket = True

Summary criteria (this is the part I don't know how to to, it would not be any problem if I could write it in T-SQL):

MAXIMUM DATE WHERE System Note.Printed Picking = TRUE < MAXIMUM DATE - System Note.Committed WHERE NEW VALUE > 0

--

The result set can then be grouped by document number.

Any ideas how I can achieve this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source