Skip to content

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

Description

@Franco111000

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    ApprovedThe issue is approvedSCMGitHub request for SCM area

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions