[Bug]: Record links are not copied to posted Phys. Invt. Order and Recording on posting
Describe the issue
Record links (the standard Notes/Links factbox) attached to a Phys. Invt. Order Header or a Phys. Invt. Recording Header are not transferred to the posted documents when the order is posted. Codeunit 5884 "Phys. Invt. Order-Post" never calls "Record Link Management".CopyLinks, unlike other posting flows in the Base Application (sales, purchase, warehouse receipts/shipments), which all copy record links to their posted history tables.
Verified still present in current main: src/Layers/W1/BaseApp/Inventory/Counting/Document/PhysInvtOrderPost.Codeunit.al contains no CopyLinks call in InsertPostedHeader() or InsertPostedRecordings().
The fix is to call RecordLinkManagement.CopyLinks(PhysInvtOrderHeader, PstdPhysInvtOrderHdr) after the header insert in InsertPostedHeader(), and RecordLinkManagement.CopyLinks(PhysInvtRecordHeader, PstdPhysInvtRecordHdr) after each recording header insert in InsertPostedRecordings().
Expected behavior
Notes and links on the unposted Phys. Invt. Order and Phys. Invt. Recording transfer to the Posted Phys. Invt. Order and Posted Phys. Invt. Recording on posting, consistent with every other posting flow.
Steps to reproduce
- Create a Phys. Invt. Order with one or more lines for recording and add a Note in the standard factbox.
- Create and finish a Phys. Invt. Recording, also with a Note added in the standard factbox.
- Finish and post the Phys. Invt. Order.
- Open the Posted Phys. Invt. Order and Posted Phys. Invt. Recording: no Notes were transferred.
Additional context
This is a copy of microsoft/BusinessCentralApps#1610 (labeled Approved/SCM in the contribution pilot). It was being fixed in microsoft/BusinessCentralApps#1900, which was reviewed (a regression test was requested and added) but was closed unmerged when the repository was retired. Re-filing here per the retirement notice to re-submit the fix against BCApps.
I will provide a fix for a bug
- [x] I will provide a fix for a bug
:robot: AI triage completed. Product group, please validate the triage report (Microsoft internal access only, use Ctrl+Click to open in new tab).
Was this triage helpful? React with :thumbsup: or :thumbsdown: on this comment to provide feedback.