Faisal
Faisal

Reputation: 85

Filter on the SalesOrder LineItems Committed Quantity

I've created the saved search in which I'm getting both the sales order main line and line items columns in result.

I want to filter the sales order based on the line items committed quantity.

Filter Needs to Apply,

If the SUM of all the line items committed quantity for any sales order is greater than zero then include it in the result.

In the below example the saved search filter needs to filter out the Sales Order 2.

Example:

Sales Order - 1: LineItem1 -> Committed Quantity - 1 LineItem2 -> Committed Quantity - 0

Sales Order - 2: LineItem1 -> Committed Quantity - 0 LineItem2 -> Committed Quantity - 0

Is this possible in Netsuite ?

Thanks,

Faisal Nasir

Upvotes: 1

Views: 1332

Answers (1)

prasun
prasun

Reputation: 7343

Yes, that is possible through saved search (you need to use summary criteria and summary fields). But, the results would be grouped by the SO internalid

In the standard criteria use "Type is Sales Order" In the summary criteria use "Sum QuantityCommitted is greaterthan 0"

In the results,

1) add Internalid field with Summary Type as Group

2) add Quantity Committed field with Summary Type as Sum

The results will include only SO internal ids and quantity committed count. Including more fields in search may break the expected behaviour.

You could use nlapiLoadSearch(null, SEARCH_ID).runSearch().getResults(0, 1000) to get results and then iterate over results to get Ids and fire another search if you need other details in the search.

Upvotes: 1

Related Questions