Hi ,
how to flow the data from purchase header to value entry using vs code in Business Central?
Hi ,
how to flow the data from purchase header to value entry using vs code in Business Central?
thank you
Hi, please try the following.
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 50134 ItemJournalLineExt extends "Item Journal Line" { fields { field(50100; ZYTest; Text[100]) { Caption = 'ZY Test'; DataClassification = CustomerContent; } } } tableextension 50135 ValueEntry extends "Value Entry" { fields { field(50100; ZYTest; Text[100]) { Caption = 'ZY Test'; DataClassification = CustomerContent; } } } pageextension 50135 ValueEntries extends "Value Entries" { layout { addafter("Document No.") { field(ZYTest; Rec.ZYTest) { ApplicationArea = All; } } } } codeunit 50134 FlowDatatoValueEntry { [EventSubscriber(ObjectType::Table, Database::"Item Journal Line", 'OnAfterCopyItemJnlLineFromPurchHeader', '', false, false)] local procedure OnAfterCopyItemJnlLineFromPurchHeader(var ItemJnlLine: Record "Item Journal Line"; PurchHeader: Record "Purchase Header"); begin ItemJnlLine.ZYTest := PurchHeader.ZYTest; end; [EventSubscriber(ObjectType::Codeunit, Codeunit::"Item Jnl.-Post Line", 'OnBeforeInsertValueEntry', '', false, false)] local procedure OnBeforeInsertValueEntry(var ValueEntry: Record "Value Entry"; ItemJournalLine: Record "Item Journal Line"; var ItemLedgerEntry: Record "Item Ledger Entry"; var ValueEntryNo: Integer; var InventoryPostingToGL: Codeunit "Inventory Posting To G/L"; CalledFromAdjustment: Boolean; var OldItemLedgEntry: Record "Item Ledger Entry"; var Item: Record Item; TransferItem: Boolean; var GlobalValueEntry: Record "Value Entry"); begin ValueEntry.ZYTest := ItemJournalLine.ZYTest; end; }
Thanks.
ZHU
thank you
Hi Arepaka Sai ,
Not sure what is the requirement but you can use Codeunit 22, check what are the events available to transfer data from Purchase Line to Value entry when you do post any receipt. In the same way you can try to use those events and send data from Purchase header to Value entry.
Thanks.
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