Hi,
How to flow the data from purchase header to detailed vendor ledger entry using VS code in business central?
Hi,
How to flow the data from purchase header to detailed vendor ledger entry using VS code in business central?
Thank you
Hi, just a idea, You can easily pass the value to the Vendor Ledger Entry as follows.
tableextension 50133 PurchaseHeaderExt extends "Purchase Header" { fields { field(50100; ZYTest; Text[100]) { Caption = 'ZY Test'; DataClassification = CustomerContent; } } } pageextension 50133 PurchaseOrderExt extends "Purchase Order" { layout { addafter(Status) { field(ZYTest; Rec.ZYTest) { ApplicationArea = All; } } } } tableextension 50135 "Vend Ledg. Entry Ext" extends "Vendor Ledger Entry" { fields { field(50100; ZYTest; Text[100]) { Caption = 'ZY Test'; DataClassification = CustomerContent; } } } pageextension 50135 "Vend Ledg Entries Ext" extends "Vendor Ledger Entries" { layout { addafter("Document No.") { field(ZYTest; Rec.ZYTest) { ApplicationArea = All; } } } } codeunit 50134 FlowDatatoDtlVendorLedgEntry { [EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch.-Post", 'OnAfterPostInvoice', '', false, false)] local procedure OnAfterPostInvoice(var PurchHeader: Record "Purchase Header"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; TotalPurchLine: Record "Purchase Line"; TotalPurchLineLCY: Record "Purchase Line"; CommitIsSupressed: Boolean; var VendorLedgerEntry: Record "Vendor Ledger Entry"); begin VendorLedgerEntry.ZYTest := PurchHeader.ZYTest; VendorLedgerEntry.Modify(); end; }
Then create a Flow field in detailed vendor ledger entry to get data from Vendor Ledger Entry.
More details: https://yzhums.com/5802/
Hope this helps.
Thanks.
ZHU
Hello - We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist. If you need assistance with debugging or coding I would recommend discussing this on one of our communities.
I will open this up to the community in case they have something to add.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156