Hi there. I have a requirement for D365 Finance and Operations that requires some X++ code to be written for the following scenario.
Given a production order whose status has changed to "Reported as Finish", how can I retrieve a list of items that were created and are now in inventory as well as include the serial number of each item that was assigned to the item when the production order was reported as finish.
With a production order ID, I am trying to understand which tables need to be queried to get the list of items and their associated serial numbers.
I have code that triggers when the status is changed to "Reported as Finish" but could use some direction on the best way to query for the needed data.
The production order table has a field called InventTransID (Lot ID). Using this value, you can find records in the table InventTrans. Using the status field you can check if the quantities were reported as finished or still pending. The field InventDimId on each record refers to a record in the InventDim table where you can find the related serial number.
Was this reply helpful?YesNo
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.