Dynamics 365 Business Central – Using a Negative Quantity on a Sales Order to Return Items

I ran into a situation recently where a user had shipped some goods from a Sales Order, which had subsequently been returned prior to the Sales Order being Invoiced. This led me to discover an interesting way to return the goods, and then invoice the Sales Order all at the same time.

After some testing I realised they could add a negative line for the same item, and ship and invoice this all at the same time.

The exact situation and steps I took are described below.

Below is a Sales Order that has a quantity of 10 that have been shipped:

Prior to invoicing this the client has returned 2 therefore I’ve reopened the Sales Order and added an additional line item for -2 for the same item.

I can now Ship and Invoice all the lines which will return 2 into my inventory and also only invoice a total of 8.

If I now check my Item Ledger Entries I can see both entries for this item. There’s a negative 10, as we originally shipped 10, and a positive 2 for the items returned.

I tested this with and without different location settings such as “Require Warehouse Receive” and “Require Warehouse Shipment” and it seems to work fine. I didn’t test it with full WMS switched on and I suspect it may hit problems there.

Thanks for reading!

Dynamics NAV – The Warehouse Request does not exist when posting an Inventory Pick

I recently came across the following error when trying to post an Inventory Pick in Dynamics NAV 2018

On investigation this is being caused because although the Inventory Pick had been created from the Sales Order, the Sales Order had subsequently been shipped and invoiced directly from the Sales Order screen rather than via the Inventory Pick. (this surprised me as I assumed the system would prevent the Sales Order from being shipped and invoiced from the Sales Order if an unposted Inventory Pick existed for it)

For clarity, as I understand things when a location has the “Require Pick” option ticked in the location setup (important to note “Require Shipment” isn’t ticked) the usual process for shipping and invoicing a Sales Order would be:

  1. Create the Sales Order.
  2. Release the Sales Order.
  3. Create the Inventory Pick in a push or pull fashion from the Sales Order.
  4. Post the shipment from the Inventory Pick.
  5. Post the Invoice from the Sales Order.

It seems that somewhere between point 3 and 4 someone had opened the Sales Order and clicked “Post” and selected “Shipment and Invoice” even though the Inventory Pick was still unposted.

On investigation this removes the internal “Warehouse Request” from the warehouse request table and when you try and post the Inventory Pick you are presented with the error “The Warehouse Request does not exist”.

As far I can see the only option here is to delete the Inventory Pick as it can’t be progressed. (I also assume the goods have been shipped)

I’ve tested this same process on a version of Dynamics 365 Business Central and it seems to prevent the Sales Order being shipped and invoiced if an Inventory Pick exists for it. When you do try you get the message below:

This does make more sense to me, I’m just surprised Dynamics NAV doesn’t prevent it.

As with all issues I did learn something new and also had fun looking at the importance of the internal Warehouse Request with all this. This is something I’m hoping to look at it more depth in future.

Thanks for reading!

Dynamics 365 Business Central – Error drilling back to the Purchase Order from a Sales Order drop shipment

I recently ran into an issue drilling back on a Purchase Order from a Sales Order with drop shipment lines. The exact error was “Purchase Order No. must have a value in Sales Line…….It cannot be zero or empty” as shown in the screen shot below:

Purchase Order No. must have a value in Sales Line

On investigation this only affected the lines on the Sales Order that had been shipped and invoiced. If I drilled back on an outstanding line on the Sales Order the Purchase Order is displayed without issue. After troubleshooting this it seems when you receive and invoice the line item on a drop shipment the system removes the link back to the Purchase Order and consequently you receive an error trying to drill down.

I’ve detailed how you can recreate the issue below, with a neat trick that can be used to view the data in the Sales Order tables via your browser.

To recreate the error first add a Sales Order with more than one drop shipment line as per below:

Sales Lines marked as Drop Shipment

Next create the Purchase Order and pull through the Sales Order using the function below

Function to Get Sales Order lines

Finally go back to the Sales Order and ship and invoice the first line

The first line has been shipped and invoiced

Now highlight the first line and try and drill back to the Purchase Order using the option below

On doing this you are prompted with the error

Purchase Order No. must have a value in Sales Line

Using the information detailed in this Microsoft article we can view the actual data even though this is the SaaS version of Business Central and I have no access to a development environment https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-view-table-data

Therefore following this document I added &table=37 to the end of my URL to view the full contents of the Sales Line table

On viewing the data in the table I can see the Purchase Order Number has been removed from the shipped and invoiced line

Purchase Order No. and Purch Order Line No. removed once shipped and invoiced

This is preventing me from drilling back on the Purchase Order. If you check the Purchase Line table (table 39) you can see the Sales Order number has also been removed, so you wouldn’t be able to drill down on the Sales Order from the Purchase Order either.

I also worked through the issue on my local Dynamics NAV install and observed the same behaviour, therefore I’m sure this is by design, however I’m unsure of the reasons. It seems the link to the Purchase Order is permanently removed once the sales line has been shipped and invoiced.

I also checked table 113, which is the Sales Invoice Line table, but this also doesn’t seem to keep the link back to the purchase order.

I’d be interested to know if I’m missing something here. Perhaps there is a way to get back to the Purchase Order from the sales document once its been posted. If there is I’d be very grateful if you could let me know.

Thanks for reading