codeunit 50112 MyCodeunit
{
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch.-Post", OnPostItemJnlLineOnAfterDocumentFields, '', false, false)]
local procedure OnPostItemJnlLineOnAfterCopyDocumentFields(var ItemJournalLine: Record "Item Journal Line"; PurchaseLine: Record "Purchase Line"; WarehouseReceiptHeader: Record "Warehouse Receipt Header"; WarehouseShipmentHeader: Record "Warehouse Shipment Header"; PurchRcptHeader: Record "Purch. Rcpt. Header");
begin
ItemJournalLine."Purch Document No." := PurchaseLine."Document No.";
end;
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Item Jnl.-Post Line", OnAfterInitItemLedgEntry, '', false, false)]
local procedure OnAfterInitItemLedgEntry(var NewItemLedgEntry: Record "Item Ledger Entry"; var ItemJournalLine: Record "Item Journal Line"; var ItemLedgEntryNo: Integer);
begin
NewItemLedgEntry."Purch Document No." := ItemJournalLine."Purch Document No.";
end;
}
tableextension 50112 MyExtension extends "Item Journal Line"
{
fields
{
field(50000; "Purch Document No."; Code[20])
{
Caption = 'Purch Document No.';
DataClassification = CustomerContent;
}
}
}
tableextension 50113 MyExtension2 extends "Item Ledger Entry"
{
fields
{
field(50000; "Purch Document No."; Code[20])
{
Caption = 'Purch Document No.';
DataClassification = CustomerContent;
}
}
}
pageextension 50113 MyExtension extends "Item Ledger Entries"
{
layout
{
addafter("Document No.")
{
field("Purch Document No."; Rec."Purch Document No.")
{
ApplicationArea = All;
}
}
}
}
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... 290,263 Super User 2024 Season 2
Martin Dráb 228,112 Most Valuable Professional
nmaenpaa 101,148