microsoft / microsoft/BCApps

[Bug]: Record links are not copied to posted Phys. Invt. Order and Recording on posting

Open Beginner friendly
#9,099 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Approved Team: SCM
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
  1. Create a Phys. Invt. Order with one or more lines for recording and add a Note in the standard factbox.
  2. Create and finish a Phys. Invt. Recording, also with a Note added in the standard factbox.
  3. Finish and post the Phys. Invt. Order.
  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.