use index hint on a join in Axapta
InventTrans inventTrans;
InventDim inventDim;
;
while select inventTrans index hint ItemIdx
where inventTrans.ItemId == 'X' join inventDim
where inventDim.inventDimId == inventTrans.inventDimId
&& inventDim.inventBatchId == 'Y'
InventTrans inventTrans;
InventDim inventDim;
;
while select inventTrans index hint ItemIdx
where inventTrans.ItemId == 'X' join inventDim
where inventDim.inventDimId == inventTrans.inventDimId
&& inventDim.inventBatchId == 'Y'