Options

How does NAV know which upgrade codeunits to run?

rsaritzkyrsaritzky Member Posts: 469
Hi all,

I'm working through a NAV2009->NAV2016 upgrade, and am at the step where I have to run the NAV2015 Data upgrade step.

I'm getting an error at the end of the data upgrade process "Object ID Not Found". I know it is at the end of the upgrade because:
1. The upgrade objects are marked "Upgrade Toolkit Object - marked for deletion". - this version tag change happens in the last line of Upgrade codeunit 104055:

UPG6080Main.UpgradeMethods;
COMMIT;
UPGDIM6080.UpdateDimensionTables;
// Mark upgrade toolkit objects for deletion once
IF IsLastCompanyInDatabase THEN
MarkUpgradeToolkit.MarkTablesForDeletion;[

Since the objects are tagged as Marked for Deletion, then the codeunit has executed this step.

2. I ran a SQL Trace and saw the updates of the last tables in the upgrade codeunit (Post Codes)

So I'm trying to figure out why I'm getting this error - all the steps appear to have been completed successfully. So, I'm thinking "is it possible that the Data Upgrade process is trying to find ANOTHER upgrade codeunit for some reason? So I began looking for other upgrade codeunits - perhaps "phantom" ones.

So I noticed that CU104051 "UPG6080.NA" is also subtype "Upgrade".


The MSDN article on upgrade codeunits https://msdn.microsoft.com/en-us/library/dn762348(v=nav.80).aspx says

"The data upgrade process is controlled by the Microsoft Dynamics NAV Server instance that connects to the database. When you start a data upgrade, the Microsoft Dynamics NAV Server instances runs all upgrade codeunits that are available for the application"

So, my question is: How does NAV know which upgrade codeunit(s) to run? CU104055 calls CU104051, so how does NAV know this? Is it the fact that in CU104055 there is one FUNCTION that has a FunctionType of "Upgrade" (all the other functions in both codeunits have a functionType = "Normal"). Is that what NAV is looking at?

Ron
Ron

Best Answer

Answers

  • Options
    DenSterDenSter Member Posts: 8,304
    I've spent some time looking into that as well, and I believe it's explained somewhere in the MSDN help. I can't find the links right now but maybe you can follow my rabbithole and see if you find it yourself. I had to change some field definition and kept running into an error message where it would not allow me to make the change. Something to do with the save option, and it would only finish if I had an upgrade codeunit and a copy of the 'old' table, so the system could automatically 'upgrade' the data as it saves the data. Not sure if that helps, but I do remember reading about it.
Sign In or Register to comment.