Here's my original example that works fine without specifying a batch. The reservation of batch is automatic, I assume FIFO is applied, and it picks up batch 1 out of the 5 available.
select inventTrans
where inventTrans.ItemId == _salesLine.ItemId
&& inventTrans.StatusReceipt == StatusReceipt::None
&& inventTrans.StatusIssue == StatusIssue::OnOrder
exists join inventTransOrigin
where inventTransOrigin.RecId == inventTrans.InventTransOrigin
&& inventTransOrigin.InventTransId == _salesLine.InventTransId;
inventmovement = inventTrans.inventmovement(true);
inventUpd_Reservation = InventUpd_Reservation::newInventDim(inventmovement, inventTrans.inventDim(), inventTrans.Qty, false);
inventUpd_Reservation.updatenow();
inventBatchId = "123456BATCH";
inventDim.clear();
inventDim.data(InventDim::find(_salesLine.InventDimId));
inventDim.InventBatchId = InventBatch::find(inventBatchId, _salesLine.ItemId).inventBatchId;
inventDim = InventDim::findOrCreate(inventDim);
inventMovement = InventTrans::findTransId(_salesLine.InventTransId).inventMovement(true);
inventUpd_Reservation = InventUpd_Reservation::newInventDim(inventmovement, inventDim, inventTrans.Qty, false);
inventUpd_Reservation.updatenow();
Any suggestions are appreciated as always.