Search code examples
netsuitesaved-searches

How can I aggregate transaction line item details for a purchase order?


I'm trying to add a custom field to a transaction (purchase order). I'd like to derive a (pallets required) value for each (Lot Assembly) item and aggregate that up to totals for the order ("whole pallets" and "sum of fractions of pallets").

Using a saved search, I can get a list of items from the order, and the estimated pallets for each - but I can't collect that up to a total for the whole order (so I can't associate it with the custom field I've created). Similarly, I can't find what sort of search I need to populate an additional custom field on each item with the number of pallets, for that line item.

Ideally, I'd like this value not to be stored anywhere because the items in the order can change for a number of reasons.


Solution

  • Your saved search can use a Sum aggregate function to total the pallets.

    If the pallet estimate is a field on the item you can get that on the transaction by making a custom column field and sourcing it from the field on the item.

    So - source the pallet estimate to the transaction

    search and total the pallets to a single row/column result on the saved search with the search filtered by transaction