Parameters:
- _itemId - The Item Id for the item
- _inventDim - The inventory dimension record for the item (variant)
- _date - The date that we want to see the on hand inventory amount for
private Qty findOnHandByDate(ItemId _itemId, InventDim _inventDim, Date _date)
{
InventDimParm inventDimParmCrit;
InventSumDateDim inventSumDateDim;
;
// Set the dimensions
inventDimParmCrit.initFromInventDim(_inventDim);
inventSumDateDim = inventSumDateDim::newParameters(_date, _itemId, _inventDim, inventDimParmCrit);
return InventSumDateDim.postedQty();
}
Hi
ReplyDeleteThanks for posting this. Just a quick question. If you do not specify any inventory dimensions, will it return on hand values for all dimensions (locations)?
Kind regards
Stephen
Stephen,
DeleteThe fast answer to your question is yes. If you use the record which has an inventDimId of 'AllBlank', then it will let you know the physical inventory qty for your entire legal entity (across all warehouses).
Here is a quick job using the code above to find legal entity wide inventory for Item 'A0001'.
static void Job5(Args _args)
{
InventDimParm inventDimParmCrit;
InventSumDateDim inventSumDateDim;
InventDim inventDim = InventDim::find('AllBlank');
;
// Set the dimensions
inventDimParmCrit.initFromInventDim(inventDim);
inventSumDateDim = inventSumDateDim::newParameters(today(), 'A0001', inventDim, inventDimParmCrit);
info(strFmt("%1", InventSumDateDim.av()));
}
.av() is not even there in this class.
ReplyDelete.av() from the comment was a typo. I am not able to edit the comments.
DeleteFollowing the code example in the post and looking contextually at the comment that contains the typo, you can infer that the .av() should be .postedQty() like in the example from the blog post.
Are you confused or have a specific question?
Hi Justin,
ReplyDeleteHow do i get the Physical reserved or Available Physical for the past dates? The above method helps me to get the Physical Available and thanks for that