It depends on NAV version. There are some differences between NAV 2016 and older.
In the NAV 2013 and older, you could just update the dimension field. In the new versions, you have to update the dimension field and the dimension set ID field. The best way is to look at Codeunit 408 (DimensionManagement) - on the function ValidateShortcutDimValues. This function has two parameters that provide the right values. The first one allows you to define the dimension value and the second one provides the dimension set ID (it is calculated from the dimension combination).
So you have to create a new codeunit which will fill the empty dimension fields
It depends on NAV version. There are some differences between NAV 2016 and older.
In the NAV 2013 and older, you could just update the dimension field. In the new versions, you have to update the dimension field and the dimension set ID field. The best way is to look at Codeunit 408 (DimensionManagement) - on the function ValidateShortcutDimValues. This function has two parameters that provide the right values. The first one allows you to define the dimension value and the second one provides the dimension set ID (it is calculated from the dimension combination).
So you have to create a new codeunit which will fill the empty dimension fields
Thank you for answering me. It was helpful.
I create a new codeunit and a function where I did the following:
- Check in the table Dimension Set Entry, by Dimension Set Id field if there are dimension for the entries, If we find we enter in table G/L Entry
- If we don't find dimensions in Dimension Set Entry table we search in headers(table Sales Invoice Header,Sales Cr.Memo Header,Purch. Inv. Header,Purch. Cr. Memo Hdr.) If we find dimension value that in headers that qe didn't find in Dimension Set Entry table we add in G/L entry table and also e should add this dimension value that we found in Dimension Set ENtry table, we should also update the Dimension Set Entry table using CodeUnit 408 using functions GetDimensionSet and GetDimensionSetID.
Answers
In the NAV 2013 and older, you could just update the dimension field. In the new versions, you have to update the dimension field and the dimension set ID field. The best way is to look at Codeunit 408 (DimensionManagement) - on the function ValidateShortcutDimValues. This function has two parameters that provide the right values. The first one allows you to define the dimension value and the second one provides the dimension set ID (it is calculated from the dimension combination).
So you have to create a new codeunit which will fill the empty dimension fields
Thank you for answering me. It was helpful.
I create a new codeunit and a function where I did the following:
- Check in the table Dimension Set Entry, by Dimension Set Id field if there are dimension for the entries, If we find we enter in table G/L Entry
- If we don't find dimensions in Dimension Set Entry table we search in headers(table Sales Invoice Header,Sales Cr.Memo Header,Purch. Inv. Header,Purch. Cr. Memo Hdr.) If we find dimension value that in headers that qe didn't find in Dimension Set Entry table we add in G/L entry table and also e should add this dimension value that we found in Dimension Set ENtry table, we should also update the Dimension Set Entry table using CodeUnit 408 using functions GetDimensionSet and GetDimensionSetID.
Thank you
Maddy.