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...
Unanswered

Reservation sequence from AL code

(0) ShareShare
ReportReport
Posted on by

Hi,

In a Production application, in case we want to create a Reservation (for a SalesLine as an example) with Lots or S/N, I am trying to AL code the logic to perform this Auto Reservation, but in vain.

Below I my current code that is failing. I have been trying many different approaches but I simply cannot.

       var ReservMgt: Codeunit "Reservation Managment"
 
        ReservEntry.Init();
        ReservEntry."Item No." := MatReq."Item No.";
        ReservEntry."Location Code" := MatReq."Location Code";
        // populate as many fields as possible ......
       
        ReservMgt.SetExternalDocumentResEntry(ReservEntry, false);
        ReservMgt.AutoReserveOneLine(1, QtyToReserve, QtyToReserve, MatReq.Description, DT2Date(MatReq."Requested Delivery Date"));
 
I have also tried the ReservMgt.AutoReserve(), but it does not work.
 
I suspect that the ItemTracking shall be specified before. Not sure.


 
Reservation Entries.png
Reservation_AutoReserve.png
I have the same question (0)

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,334 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,717 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,470

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans