
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"));