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

Notifications

Announcements

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,708 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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,585

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 780 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 712 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans