Take a look at DimensionManagement codeunit: I think UpdateGlobalDimFromDimSetID function can match your case, it's used also in Sales Line/Purchase Line tables.
Calling it with parameters referring to your record will fix the emptyShortcut Dimension 1 Code, if it's included in the related Dimension Set Entry value, of course.
One thing is fixing the issue, but you must also have some error in your code somewhere, since you got into this situation, so I think it is important to identify that error first. And is it really only the G/L Entries then? What about all the other tables that have Global/Shortcut dimension 1?
Assuming that this is an issue in all your tables, I think the simplest and safest solution to fix it is to use the "Change Global Dimensions" function from the "General Ledger Setup" page, as that will go through all tables and update them as necessary.
I had suggested MS to add a check in CU 11 to check that Dimension Set Entry values are the same as shortcut for the journal because so many people make the mistake and not populating the global 1 and 2 on journal line but nothing has happened.
Ahmed Rashed Amini
Independent Consultant/Developer
I had suggested MS to add a check in CU 11 to check that Dimension Set Entry values are the same as shortcut for the journal because so many people make the mistake and not populating the global 1 and 2 on journal line but nothing has happened.
Comments
Calling it with parameters referring to your record will fix the emptyShortcut Dimension 1 Code, if it's included in the related Dimension Set Entry value, of course.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Assuming that this is an issue in all your tables, I think the simplest and safest solution to fix it is to use the "Change Global Dimensions" function from the "General Ledger Setup" page, as that will go through all tables and update them as necessary.
Microsoft - Dynamics NAV
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
From a user or developer standpoint?
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n