Dear community,
We're running AX 2012 R3 CU10 and the "Inventory Management --> Periodic --> Clean up --> Warehouse management on hand entries clean up" cleans up inventsum records with posted values.
When the batch jobs cleans up inventsum records with inventory and inventory value we're receiving errors that the standard costs do not comply. This occurs because records in inventsum are deleted and the total inventory value doesn't match up with the quantity.
When we're running the consistency check it luckily restores the missing inventsum records.
From what I can analyse the batch checks the Inventsum and WHS inventreserve
WHSInventReserve:
private boolean validateWHSInventReserveRecsDeleted(InventTable _inventTable, InventDim _inventDim)
{
WHSInventReserve whsInventReserve;
InventDim inventDimCriteria;
WHSReservationHierarchyElement resHierarchyElement;
InventDim inventDim;
InventDimParm inventDimParm;
inventDimCriteria.data(_inventDim);
inventDimCriteria.clearFieldsFromHierarchyList(WHSReservationHierarchyProvider::construct().
getDimListBelowLocation(_inventTable, WHSReservationHierarchySortOrder::BottomUp));
inventDimParm.initFromInventDim(inventDimCriteria);
select firstOnly RecId from whsInventReserve
where whsInventReserve.ItemId == _inventTable.ItemId
&& (whsInventReserve.AvailOrdered == 0
&& whsInventReserve.AvailPhysical == 0
&& whsInventReserve.ReservOrdered == 0
&& whsInventReserve.ReservPhysical == 0)
#InventDimExistsJoin(whsInventReserve.InventDimId, InventDim, inventDimCriteria, inventDimParm)
exists join resHierarchyElement
where resHierarchyElement.ReservationHierarchyLevel == WHSInventReserve.HierarchyLevel
&& resHierarchyElement.ReservationHierarchy == reservationHierarchy
&& resHierarchyElement.ReservationHierarchyLevel >= highestReservationLevel;
return whsInventReserve.RecId == 0;
}
InventSum
protected boolean validateInventSumDelete(InventSum _inventSum)
{
boolean ret;
WHSReservationHierarchyLevel level;
ret = super(_inventSum);
if (ret)
{
level = WHSReservationHierarchyInventDimUtil::getLevelOfFirstBlankDim(_inventSum.ItemId,
_inventSum.inventDim(),
WHSReservationHierarchySortOrder::TopDown);
// Do not delete <c>InventSum</c> record if the dimension set is above the highest reservation level to delete.
if (level < highestReservationLevel
&& level != 0) // if there are no blank dimension fields then level will be zero.
{
ret = false;
}
}
return ret;
}
Is this because the WHSInventReserve and InventSum tables are out of sync? Because the WHSInventReserve validation checks if all records are 0? What I also find strange is that this batch doesn't check if inventsum records are 0 as the regular On Hand entries clean up.
Looking at the code isn't it more efficient to clean-up all WHSInventReserve and InventSum records on SQL, where all records are 0?
*This post is locked for comments
I have the same question (0)

Report
All responses (
Answers (