web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

how to flow fields from reservation entry on posting purchase document.

(0) ShareShare
ReportReport
Posted on by 151

Anyone know the event which help me to flow data from reservation entries to item ledger entry on posting purchase document.

I am not able to find it.
Thanks in advance.

I have the same question (0)
  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

    Hi,

    Can you try take idea from codeunit 90 with below event? This is an Idea just.

    procedure OnBeforePostItemJnlLine(PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; var QtyToBeReceived: Decimal; var QtyToBeReceivedBase: Decimal; var QtyToBeInvoiced: Decimal; var QtyToBeInvoicedBase: Decimal; var ItemLedgShptEntryNo: Integer; var ItemChargeNo: Code[20]; var TrackingSpecification: Record "Tracking Specification"; CommitIsSupressed: Boolean; var IsHandled: Boolean; var ItemJnlPostLine: Codeunit "Item Jnl.-Post Line"; var Result: Integer)

    var

       ReservationEntry: Record "Reservation Entry";

       ItemLedgerEntry: Record "Item Ledger Entry";

    begin

       // Retrieve the reservation entries related to the purchase

       ReservationEntry.SetRange("Document Type", ReservationEntry."Document Type"::"Purchase Invoice");

       ReservationEntry.SetRange("Document No.", PurchaseInvoiceHeader."No.");

       if ReservationEntry.FindSet then

       begin

           // Flow data from reservation entries to item ledger entries

           while ReservationEntry.Next = true do

           begin

               ItemLedgerEntry."Entry Type" := ItemLedgerEntry."Entry Type"::Reservation;

               ItemLedgerEntry."Item No." := ReservationEntry."Item No.";

               ItemLedgerEntry."Variant Code" := ReservationEntry."Variant Code";

               ItemLedgerEntry.Quantity := ReservationEntry.Quantity;

               ItemLedgerEntry.Insert;

           end;

       end;

    end;

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,474 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 864 Super User 2026 Season 1

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 851 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans