Copy record links to posted Phys. Invt. Order and Recording headers#9180
Open
Franco111000 wants to merge 1 commit into
Open
Copy record links to posted Phys. Invt. Order and Recording headers#9180Franco111000 wants to merge 1 commit into
Franco111000 wants to merge 1 commit into
Conversation
Posting a Physical Inventory Order now transfers record links (Notes factbox) from the Phys. Invt. Order Header and Phys. Invt. Recording Header to their posted counterparts, consistent with the other posting flows in the Base Application. Fixes microsoft#9099. Re-submission of microsoft/BusinessCentralApps#1900.
Contributor
|
@Franco111000 please label your PRs with SCM or Finance (depends on the area you're fixing) so that we can find and review them faster :) Thanks! |
Contributor
Author
|
Sure thing @alexei-dobriansky! I tried to add the label just now but it seems I don't have label permissions on the repo, so correct me if I'm wrong on how contributors are meant to apply them. In case a maintainer can set them meanwhile, the mapping for my open PRs (mirroring each linked issue's area label) is: #9180, #9181, #9182, and #9096 are SCM, #9098 is Finance. Happy to label them myself on every future PR once I have the ability. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Record links (the standard Notes and Links factboxes) attached to a Phys. Invt. Order Header or a Phys. Invt. Recording Header were lost on posting: codeunit 5884 "Phys. Invt. Order-Post" never called
"Record Link Management".CopyLinks, unlike the sales, purchase, and warehouse posting flows, which all carry record links over to their posted history tables.This change copies the links in the two places where the posted headers are inserted:
RecordLinkManagement.CopyLinks(PhysInvtOrderHeader, PstdPhysInvtOrderHdr)after the insert inInsertPostedHeader(), andRecordLinkManagement.CopyLinks(PhysInvtRecordHeader, PstdPhysInvtRecordHdr)after each recording header insert inInsertPostedRecordings(). Both calls sit inside the existingif not IsHandled thenblocks, so subscribers that replace the standard insert keep full control. A regression test posts an order with a note on both the order and the recording and verifies the links arrive on the posted documents.This is a re-submission of microsoft/BusinessCentralApps#1900 (pilot repository, retired). The fix and the test were reviewed there; the regression test was added at the reviewer's request. The pilot PR was closed unmerged by the repository retirement.
Linked work
Fixes #9099
Original pilot review: microsoft/BusinessCentralApps#1900 (fixing microsoft/BusinessCentralApps#1610).
How I validated this
What I tested and the outcome
InsertPostedHeader()norInsertPostedRecordings()referencesCopyLinksorRecord Link Managementanywhere in the codeunit, so the defect is still present.CopyLinksOnPostingPhysInvtOrderin PhysInvtItemTracking.Codeunit.al mirrors the existingDropShipmentCopyLinksOnPostingReceiptShipmentpattern: it attaches a record link to both the Phys. Invt. Order Header and the Phys. Invt. Recording Header, posts the order, and asserts both posted headers carry the link. The test was reviewed in the pilot PR.using System.Utilities;is inserted in alphabetical position for theRecord Link Managementreference.Risk & compatibility
IsHandledgates right after the standard inserts, so event subscribers that take over the insert are unaffected.