Default Dimension Priorities for Production Order Components
In one of my earlier blog posts, Dimensions on Production Orders, I described how the dimensions on the production orders in Microsoft Dynamics NAV gets populated and posted. In that blog post I described that the dimensions on the production order components are inherited from the production order lines and therefor the consumption is posted with dimensions according to the default dimensions of the output item.
If this is not wanted (which is quite common) then Dynamics NAV can easily be changed to accommodate posting consumption with dimensions according to the components instead.
Here is one way of doing it.
In other parts of the application (like on a sales and purchase documents) you have the option to specify default dimension priorities to define what would happen if a conflict arrive where two entities have different dimension values for the same dimension. Lets use the same method for the production orders (I am a big fan of reusing concepts that are in other areas since this creates consistency throughout the application).
We start with adding a Manufacturing source code to the Source Code setup table and page. The field have a table relationship to the source code table just like the rest of the fields in this setup table. We also create a new source code record, calls it ‘MFG’ and selects it in our new manufacturing field in the source code setup table.
Next we need to add some code in the dimension management Codeunit (408) to allow selecting the production order lines in the default dimension priority page. The code to add is according to below (in Codeunit 408, function SetupObjectNoList).
After this we can go ahead and setup our default dimension priorities to prioritize item dimensions before production order line dimensions. We do this by selecting the source code ‘MFG’ and list the item and prod. order line tables with priority 1 and 2.
Now we have done the setup, what is left is to go and change the code that retrieves the dimension set id for the production order components. The code to change is in table 5407 – Prod. Order Component and the function called CreateDim. As you can see I have deactivated the some original code and entered a couple of lines very similar but with the source code from the source code setup table and with the table to inherit from being the prod. order line.
This is it!
Now we have a system that allow us to setup (through the default dimension priorities) if we want the production order components to have the dimensions from their default dimensions or replace the same dimensions inherited from the production order line. Nice! 🙂