Thanks for the info! I wasn't aware of these two other resources, as I thought that this Dynamics 365 Community area was the best place. Will check them out.
Just for some closure, and if anyone else would be interested, below is the AL code that accomplishes what I was looking to implement. Hope it helps someone who might run across it in the future.
procedure InsertItemJournal(ItemNo: Text; SerialNo: Text; LocationCode: Text; Qty: Integer; UnitCost: Decimal; DateIn: Text; VendorDocNo: Text; OurDocNo: Text; Descr: Text; ShortDim1Code: Text; ShortDim2Code: Text)
var
ItemJnl: Record "Item Journal Line";
TempReservEntry: Record "Reservation Entry" temporary;
Rec_ResEnt_Lu: Record "Reservation Entry";
CreateReservEntry: Codeunit "Create Reserv. Entry";
ReservStatus: Enum "Reservation Status";
LineNo: Integer;
ValDateIn: Date;
begin
ItemJnl.Init();
if ItemJnl.FindLast() then
LineNo := ItemJnl."Line No." 10000
else
LineNo := 10000;
ItemJnl."Line No." := LineNo;
ItemJnl."Entry Type" := ItemJnl."Entry Type"::"Positive Adjmt.";
ItemJnl.Validate("Item No.", ItemNo);
ItemJnl.Validate("Document No.", VendorDocNo);
if OurDocNo = '' then
ItemJnl.Validate(Description, Descr)
else
ItemJnl.Validate(Description, OurDocNo);
ItemJnl.Validate("Journal Batch Name", 'DEFAULT');
ItemJnl.Validate("Journal Template Name", 'ITEM');
ItemJnl.Validate(Quantity, Qty);
ItemJnl.Validate("Location Code", LocationCode);
ItemJnl.Validate("Unit Amount", UnitCost);
Evaluate(ValDateIn, DateIn);
ItemJnl.Validate("Posting Date", ValDateIn);
ItemJnl.Validate("Shortcut Dimension 1 Code", ShortDim1Code);
ItemJnl.Validate("Shortcut Dimension 2 Code", ShortDim2Code);
ItemJnl.Insert();
Commit();
TempReservEntry.Init();
Rec_ResEnt_Lu.Reset();
if Rec_ResEnt_Lu.FindLast() then
TempReservEntry."Entry No." := Rec_ResEnt_Lu."Entry No." 1
else
TempReservEntry."Entry No." := 1;
if SerialNo <> '' then begin
TempReservEntry."Serial No." := SerialNo;
TempReservEntry.Quantity := Qty;
TempReservEntry."Expiration Date" := Today();
TempReservEntry.Insert();
Commit();
CreateReservEntry.SetDates(0D, TempReservEntry."Expiration Date");
CreateReservEntry.SetNewSerialLotNo(TempReservEntry."Serial No.", TempReservEntry."Lot No.");
CreateReservEntry.CreateReservEntryFor(Database::"Item Journal Line", ItemJnl."Entry Type".AsInteger(), ItemJnl."Journal Template Name", ItemJnl."Journal Batch Name",
0, ItemJnl."Line No.", ItemJnl."Qty. per Unit of Measure", TempReservEntry.Quantity, TempReservEntry.Quantity * ItemJnl."Qty. per Unit of Measure", TempReservEntry);
CreateReservEntry.CreateEntry(ItemJnl."Item No.", ItemJnl."Variant Code", ItemJnl."Location Code", '', 0D, 0D, 0, ReservStatus::Surplus);
end;
end;