Some time ago my customer asked me to check why NAV pickups the lowest price in the sales order, whether in sales prices the price for the particular customer was higher.
I said that’s because NAV is very kind system 🙂 and gave him this article, but business is not always so kind.
So let’s check what we have, and what can we do in next example.
Sales Price
Sales Type | Sales Code | Item No. | Unit Price |
All customers | 1000 | 4500 | |
Customer | 01121212 | 1000 | 5000 |
If we create a sales order for customer 01121212 and sell to him item 1000, then NAV will insert unit price = 4500, and not 5000 as was expected. Why? Because of best price concept.
This is written in CU 7000 “Sales Price Calc. Mgt”. FindSalesLinePrice().
Here we have 2 main functions:
- SalesLinePriceExists(SalesHeader,SalesLine,FALSE); // saves all possible prices for item in temp table. In our example, it will save two prices.
- CalcBestUnitPrice(TempSalesPrice) //get from saved temp table minimum price. In our example, it will be 4500.
I think this is not correct. If we have an agreement with a certain customer, then we should use prices from this agreement, not prices for all customers, even if they are less.
How to achieve this? Here is a solution. The idea is to delete all not relevant prices that NAV saves in temp table before it calculates the best price.
1. Insert new function DeleteAlreadyFoundSalesPrice. Don’t forget to use VAR variables.

2. Add this function in CopySalesPriceToSalesPrice function.

After such customization, our example will give 5000, as expected.