Quantcast
Channel: NAV Three Tier — mibuso.com
Viewing all articles
Browse latest Browse all 10032

Display/count number of orders that an item appears upon

$
0
0
Hi all,

I'd like to create a factbox for the Item Card that contains:

Number of Open Orders (that this item appears on)
Number of Open Invoices (that this item appears on)
Number of Open Credit Memos
Number of Posted Credit Memos
<...you get the idea>

Note this is NOT "Quantity on open orders" - this is a standard flowfield

So I want to COUNT the orders where a line EXISTS on that order. If the item is on the same order twice, I only want to count it once (yes we do that - think of same item, different variant as an example).

I've tried to construct a query object that might do this, but have been unable to do so.

I know I can create a SQL query that would do this, but I'm trying to avoid a "LinkedObject" type of table.

And I know I can create functions on the table which will loop through the lines and count them and return the count, but I'm looking for an alternative.

Has anyone tried this?

Thanks

Ron

Viewing all articles
Browse latest Browse all 10032

Trending Articles