Careful with Microsoft.Dynamics.NAV JavaScript object

Make sure that you don’t access the Microsoft.Dynamics.NAV JavaScript object before the document ready event fires. If you do so, you might experience problems on Chrome when the user refreshes the browser (F5). It appears that on refresh Chrome loads (and runs) scripts in different order, and depending on how complex scripts included in your project are, your code might get executed before Microsoft’s script is loaded, and it will cause nasty script errors. This occurs only on Chrome on PC.

3 thoughts on “Careful with Microsoft.Dynamics.NAV JavaScript object”

  1. Hey Vjeko,
    On the Tech Days in Antwerp, you showed an example with an ObjectEventhandler in the IControlAddIn.cs.
    When I’m trying to build this, I get an error saying:
    The type or namespace name ‘ObjectEventhandler’ could not be found (are you missing a using directive or an assembly reference?)
    Is the ObjectEventhandler an C# assembly or some library we can find on the internet?
    Kind regards,

Leave a Reply