NAV 2018 and Dynamics 365 Business Central: Is Rapidstart too slow? This is the fix.

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:

Rapidstart_slow_01

and this is the ApiSetup event defined in Graph Mgt – General Tools codeunit:

Rapidstart_slow_02

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:

Rapidstart_slow_03

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:

Rapidstart_slow_04

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).

 

4 Comments

  1. That explains why it takes me 40 min. to import Cronus Extended data.
    Until its fixed in BC, you can use :base to get a docker image that Includes Cronus 🙂

    Like

  2. Maybe the better solution is to put the line:
    IF GraphMgtGeneralTools.IsApiEnabled THEN
    in front of the “GraphMgtGeneralTools.ApiSetup”-Call in Codeunit 8511 in Function “FixIntegrationRecordIds”.

    Less impact. Better upgradeability.
    😉

    Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s