In an internal mailing list today was asked a question regarding Rapidstart packages in NAV 2018. Many users and partners (me too) have experienced a very slow data import with Rapidstart packages (despite the number of records to import), expecially if your database is quite big. I remember to have “unofficially” fixed this problem in my NAV 2018 databases and to have reported the solution is some discussions, but now I think it could be useful for everyone to share the fix in a blog post.
Why Rapidstart packages are so slow in NAV 2018 compared for example to NAV 2017?
The problem is a new Integration event called ApiSetup defined in Codeunit 5465 – Graph Mgt – General Tools.
When an import package is executed, at a certain point it calls the FixIntegrationRecordIDs function in codeunit 8611 – Config. Package Management and then the above ApiSetup event is raised. This event is subscribed by lots of NAV objects and codeunits and this is the main issue for the slow experience.
This is the original code in NAV 2018 for the Config. Package Management codeunit:
and this is the ApiSetup event defined in Graph Mgt – General Tools codeunit:
As you can see, the event is ALWAYS triggered and this is not good. The event should be triggered only if IsApiEnabled function returns true.
My solution reported some time ago to fix this noisy problem was to declare a new function in Graph Mgt – General Tools codeunit called ActivateAPISetupEvent (but you can call it as you want ) that triggers the event only if IsApiEnabled is true:
Then in FixIntegrationRecordIds function in Config. Package Management codeunit you have to comment the standard Microsoft’s call and instead call your newly added function:
Now your Rapidstart packages will be more performant.
What about Dynamics 365 Business Central? The problem is still live and it’s exactly the same as NAV 2018! Unfortunately, in Dynamics 365 Business Central you can’t modify standard code and actually you don’t have an event exposed by Microsoft in codeunit 8611 to change that behaviour. This should be fixed by Microsoft soon I think (I’ve reported the problem).