有人可以告诉我一种从 inventdim 获取信息的简单方法吗?我需要为项目事务获取 batchid/siteid/locationid。D365FO 我试过这个选择,但我认为它不够准确
while select InventTransOrigin join salesline where SalesLine.InventTransId == InventTransOrigin.InventTransId && SalesLine.inventtransid == ProjItemTrans::find(projInvoiceItem.ProjTransId).inventtransid join inventTrans where InventTrans.InventTransOrigin == InventTransOrigin.RecId join inventdim order by inventdim.inventBatchId desc where InventDim.inventDimId == InventTrans.inventDimId