Hi all,
I've been messing around with control add-ins for years now and it still amazes me how many times I get stuck getting them to work in NAV.
This is the current situation:
A page in a NAV 2016 dev system. It has a control add-in (JS) field for a file drop zone. Everything works fine.
I export the page and import it into a clean NAV 2015. Everything still works fine and even compiles in 2015.
I then create a new page (50000, Addin Test). Create a new field on it and select the same control add-in from the list.
Now the trouble starts. It
does not add event handlers for the 2 events that are in the add-in. But the events are visible in code in the original page in the 2015 system.
The add-in is registered correctly in the Control add-ins page in the RTC with all the same values as in 2016.
The javascript resources have been imported. And of course, it works fine in the RTC on the original page.
Original (with the events):
New page (without events):
The add-in itself could not be simpler...:
I know for a fact that the dll containing the add-in is present in the 2015 services because I see it in the 'Server' tab when I create a dotnet variable. It even lists all the types:
Any suggestions? Have I been doing something wrong all these years or is this whole add-in business still bugged as hell?
Gr, Erik
Answers
Franz Kalchmair, MVP
Alias: Jonathan Archer
please like / agree / verify my answer, if it was helpful for you. thx.
Blog: http://moxie4nav.wordpress.com/
Another add-in is complaining about not being able to load a type.
This makes no sense. Why is it looking for the .Addins.TextEditor type? There is no such type in the assembly and no reference to it whatsoever!
This is the add-in interface:
Franz Kalchmair, MVP
Alias: Jonathan Archer
please like / agree / verify my answer, if it was helpful for you. thx.
Blog: http://moxie4nav.wordpress.com/
Which is strange because the add-ins do work in the 2015 RTC. Just as long as you don't compile the objects containing them in the 2015 dev client.
I've decompiled both the 2015 and 2016 Microsoft.Dynamics.Framework.UI.Extensibility assemblies and, apart from the version number, they are identical. Do we really have to build seperate but identical add-in assemblies for 2015 and 2016!?
Come on Microsoft, don't rebuild your assemblies for new NAV releases if you don't change anything! At least make them compatible!
The WithEvents property is not obsolete. It is used in global variables of type dotnet and is mandatory for the usage of embedded windows events. It was also used in old COM/OCX Components. That one is obsolete in newer Nav versions.
Franz Kalchmair, MVP
Alias: Jonathan Archer
please like / agree / verify my answer, if it was helpful for you. thx.
Blog: http://moxie4nav.wordpress.com/