Skip to main content

Notifications

Small and medium business | Business Central, N...
Unanswered

Sales Line item tracking reservation from code does not show allocate to existing lot number

Posted on by 2,418
Hi All
Im using below code to insert item tarcking without actual reservation against item ledger entry. However when the revervation line is created it shows as an extra line rather than adding to the requested qty on reservations
 
result
requested qty must be allocted to existing lines rather than creating a new line (first line)
 
Code
    local procedure CreateReservationEntry(SalesLine: Record /Sales Line/)
    var
        TempReservationEntry: Record /Reservation Entry/ temporary;
        TempTrackingSpecification: Record /Tracking Specification/ temporary;
 
        UnitofMeasureManagement: Codeunit /Unit of Measure Management/;
        CreateReservEntry: Codeunit /Create Reserv. Entry/;
        QtyToAssign: Decimal;
        QtyToAssignBase: Decimal;
    begin
 
        QtyToAssign := SalesLine./Outstanding Quantity/;
 
        QtyToAssignBase := UnitofMeasureManagement.CalcBaseQty(QtyToAssign, SalesLine./Qty. per Unit of Measure/);
 
        TempReservationEntry./Lot No./ := 'TEST';
 
        CreateReservEntry.CreateReservEntryFor(Database::/Sales Line/, SalesLine./Document Type/.AsInteger(), SalesLine./Document No./, '', 0,
            SalesLine./Line No./, SalesLine./Qty. per Unit of Measure/, QtyToAssign, QtyToAssignBase, TempReservationEntry);
 
        begin
            CreateReservEntry.CreateEntry(SalesLine./No./, SalesLine./Variant Code/, SalesLine./Location Code/, SalesLine.Description, 0D,
                SalesLine./Shipment Date/, 0, Enum::/Reservation Status/::Surplus);
        end;
 
    end;
 
 
 
Categories:

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,228 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,056 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans