I don’t know the exact business reason but someone asked how to identify all sales shipping orders with any negative quantities on them.  They needed to print these separately from the shipments that only have all positive quantities.

Here is one way to solve this problem

In NAV, open Sales Shipment Header

clip_image001

Add a field of type Boolean (The field type should match the value you expect to return from the flow field method.  In this case we will use an exist so we expect a bool but we could have used a Sum, Average, Min, Max, Count, or a Lookup to return a value).

clip_image002

Define it as a flow field and click on the ellipse next to CalcFormula

clip_image003

clip_image004

Now [Has Negative Qty] is false if no negatives exist

clip_image006

And [Has Negative Qty] and true if a negative exist

clip_image007

So it is ready to be used as a filter on the report.

clip_image008

Don’t forget that if you are using it in code, you may need to CalcFields.

Hope that helps.  If you really can’t afford the field in your header, you can use code to check the lines for a negative value each time and use a skip or break function to skip that header record but it seems expensive to check them all if you only want a few to print.

Please let me know if you think of a better solution.