[Bug]: Record links are not copied to posted Phys. Invt. Order and Recording on posting
Nobody has claimed this yet.
- Dominant language
- AL
- Stars
- 683
- Forks
- 459
- Avg merge
- 3d 26m
- Merged PRs (30d)
- 633
Description
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
- I will provide a fix for a bug
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/Layers/W1/BaseApp/Inventory/Counting/Document/PhysInvtOrderPost.Codeunit.al and inspect InsertPostedHeader() and InsertPostedRecordings(). Compare these posting flows with other Base Application flows that copy record links, then verify that Notes and links appear on both posted documents after posting. A regression test should cover the order and recording cases, as requested in the earlier review.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100