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

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

  1. Peter Taylor 2nd Oct 2019 / 1:30 pm

    Can you navigate to the shipment from the sales order, then navigate to the purchase order from there?

    Like

    • Gavin Whittaker 2nd Oct 2019 / 1:42 pm

      Hi. I’ve just tried but i can’t see an option to drill back to the PO from the posted shipment. I am only a novice though so I could have missed something. Thanks

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s