Error in Dynamics AX Master Scheduling: Mandatory Coverage Dimension Warehouse Not Specified
Recently, one of our clients was encountering the following error when running Master Scheduling in Dynamics AX:
Mandatory coverage dimension Warehouse not specified
Cannot create a record in Planned order (ReqPO). The corresponding AOS validation failed.
Since I spent a significant amount of time debugging this issue, I thought my findings could be useful to someone else.
Both Site and Warehouse were set up as mandatory dimensions. Item coverage was defined for the items in question with Site and Warehouse as coverage dimensions.
The error was being thrown on the BOM Components at the point where a Planned Purchase Order was being created for the component. The error was thrown in this method:
Backtracking from here using Debugger, I found that throughout most of the scheduling process, the Coverage dimension (CovInventDimId) had the right value, which was the inventDimId having both Site and Warehouse – _101-M_
Yet at some point, the value was being updated to an InventDimId having Site only. The difficulty was tracking down when/where this happened.
Long story short, I found the following code. reqTransDerived is the cache for the reqTrans created for the BOM components being purchased. If it does not find an Input Warehouse for the Resource Group, the reqTransDerived.CovInventDimId is updated to the wrong value (site only inventdimid), resulting in a Planned PO missing the mandatory warehouse dimension.
To fix this error, specify an Input Warehouse for the Resource Group.
Note: The client reported that this error seemed to occur randomly. While I can’t be sure, I suspect it occurs only when there is no on-hand quantity for a BOM component with a default order type of Purchased, meaning that a Planned PO is created.
It should also be noted that the Resource Consumption field was checked on the components in this case, because for this client the BOM’s are not site-specific and can, therefore, be used at any site. If this field is not checked, the picking warehouse can be specified in the Warehouse field on the line or AX will use the picking warehouse from the item master data as documented in this TechNet article on BOM Versions and Lines in AX2012.